Skip to content

Commit

Permalink
Added documentation. Fixed issue with previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Jesus committed Jul 31, 2023
1 parent a2abcb3 commit 3e6ca3c
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public DicomMetaData load(String sopInstanceUID) throws Exception {

URI uri = retrieveURI(sopInstanceUID);
if(uri == null){
throw new InvalidParameterException("Could not find the desired URI");
throw new IllegalArgumentException("Could not find the desired URI");
}

Attributes fmi;
Expand All @@ -97,7 +97,7 @@ public DicomMetaData load(String sopInstanceUID) throws Exception {
throw new InvalidParameterException("Could not find the desired URI");
}

dis = new BufferedInputStream(sis.getInputStream());
dis = new DicomInputStream(sis.getInputStream());

dis.setIncludeBulkData(DicomInputStream.IncludeBulkData.URI);
dis.setBulkDataDescriptor(BulkDataDescriptor.PIXELDATA);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,46 @@
import java.util.Arrays;
import java.util.List;

/**
* A bulk annotation object denotes a group of annotations from a DICOM file generated by third-party services like AI algorithms.
* It follows the supplement 222 of the DICOM standard.
* Annotations in a bulk annotation object share common attributes such as shape type, label, pixel origin, etc.
*/
public class BulkAnnotation {

/**
* Denotes the pixel origin of the annotations contained in this bulk.
*/
public enum PixelOrigin {
FRAME, // Coordinates of this annotation are related to the frame (image section)
VOLUME // Coordinates of this annotation are related to the Frame Matrix (whole image)
/**
* Coordinates of this annotation are related to the frame (image section)
*/
FRAME,
/**
* Coordinates of this annotation are related to the Frame Matrix (whole image)
*/
VOLUME
}

/**
* Denotes the type of annotations contained in this bulk.
*/
public enum AnnotationType {
RECTANGLE, ELLIPSE, POLYGON, POLYLINE, POINT
}

/**
* Denotes the type of coordinates contained in this bulk
*/
public enum CoordinateType {
TWO_DIMENSIONAL, //for image relative coordinates
THREE_DIMENSIONAL //for coordinates in a Cartesian system defined by a frame of reference
/**
* For image relative coordinates
*/
TWO_DIMENSIONAL,
/**
* For coordinates in a Cartesian system defined by a frame of reference
*/
THREE_DIMENSIONAL
}

private PixelOrigin pixelOrigin;
Expand Down
30 changes: 25 additions & 5 deletions sdk/src/main/java/pt/ua/dicoogle/sdk/mlprovider/MLTrainTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,42 @@
*/
public class MLTrainTask {

public enum TRAINING_STATUS {
/**
* Status of a training task request/job.
* It is used to identify the status of training tasks in execution but also training requests.
*/
public enum TrainingStatus {
/**
* A training task was successfully submitted.
* A corresponding identifier should be generated to track the progress.
*/
SUBMITTED,
/**
* A training job identified by a ID is currently running
*/
RUNNING,
/**
* A training job identified by an ID was cancelled.
*/
CANCELLED,
/**
* A training request was not processed because the service cannot process more training requests.
*/
BUSY,
/**
* A training request was not processed because the request was malformed or some other error occured.
*/
REJECTED
}

public MLTrainTask(String taskID, TRAINING_STATUS status) {
public MLTrainTask(String taskID, TrainingStatus status) {
this.taskID = taskID;
this.status = status;
}

private String taskID;

private TRAINING_STATUS status;
private TrainingStatus status;

public String getTaskID() {
return taskID;
Expand All @@ -50,11 +70,11 @@ public void setTaskID(String taskID) {
this.taskID = taskID;
}

public TRAINING_STATUS getStatus() {
public TrainingStatus getStatus() {
return status;
}

public void setStatus(TRAINING_STATUS status) {
public void setStatus(TrainingStatus status) {
this.status = status;
}
}

0 comments on commit 3e6ca3c

Please sign in to comment.