public class IndexedLabelMapToSegmentation extends Object
Modifier and Type | Class and Description |
---|---|
protected class |
IndexedLabelMapToSegmentation.LabelInformation |
Modifier and Type | Field and Description |
---|---|
protected Integer |
backgroundIndex |
protected IndexedLabelMapToSegmentation.LabelInformation |
backgroundLabel |
protected static Set<String> |
spatialAndRelationalConcepts |
protected static Set<String> |
tissueConcepts |
Constructor and Description |
---|
IndexedLabelMapToSegmentation(String inputFilename,
String labelFilename,
String outputFilename,
String referenceImageFilename,
String seriesNumber,
String seriesDescription,
String contentLabel,
String contentDescription,
String contentCreatorName) |
protected IndexedLabelMapToSegmentation.LabelInformation backgroundLabel
protected Integer backgroundIndex
public IndexedLabelMapToSegmentation(String inputFilename, String labelFilename, String outputFilename, String referenceImageFilename, String seriesNumber, String seriesDescription, String contentLabel, String contentDescription, String contentCreatorName) throws IOException, NumberFormatException, DicomException
protected String getStringNoLongerThan64TruncatedIfNecessary(String s)
protected Map<Integer,IndexedLabelMapToSegmentation.LabelInformation> readLabelMapFile(String filename) throws IOException, NumberFormatException
IOException
NumberFormatException
protected void addAppropriateSegmentedPropertyCategoryCodeSequence(AttributeList list, IndexedLabelMapToSegmentation.LabelInformation labelinfo) throws DicomException
DicomException
protected static SequenceAttribute newCodedSequenceAttribute(AttributeTag tag, CodedSequenceItem csi)
protected static SequenceAttribute addCodedSequenceAttribute(AttributeList list, AttributeTag tag, CodedSequenceItem csi)
protected void addSegmentSequenceItem(SequenceAttribute saSegmentSequence, int index, IndexedLabelMapToSegmentation.LabelInformation labelinfo) throws DicomException
DicomException
protected void addSegmentSequenceItem(SequenceAttribute saSegmentSequence, IndexedLabelMapToSegmentation.LabelInformation labelinfo) throws DicomException
DicomException
protected Map<Integer,Integer> addSegmentSequence(AttributeList list, Set<Integer> usedLabels, Map<Integer,IndexedLabelMapToSegmentation.LabelInformation> labelMap, Set<Integer> unrecognizedLabels) throws DicomException
DicomException
protected void setBit(byte[] pixelData, int f, int r, int c, int rows, int columns)
public static void main(String[] arg)
Read a DICOM image containing pixel values that are indices into a label map and the corresponding map and convert to a DICOM Segmentation object.
arg
- three or more parameters, the inputFile, the CSV file containing a list of labels and their coded values, the outputFile, the reference image file, and optionally, the series number, series description, content label, content description and content creator