Package com.pixelmed.convert
Class IndexedLabelMapToSegmentation
- java.lang.Object
-
- com.pixelmed.convert.IndexedLabelMapToSegmentation
-
public class IndexedLabelMapToSegmentation extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
IndexedLabelMapToSegmentation.LabelInformation
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Integer
backgroundIndex
protected IndexedLabelMapToSegmentation.LabelInformation
backgroundLabel
protected static java.util.Set<java.lang.String>
spatialAndRelationalConcepts
protected static java.util.Set<java.lang.String>
tissueConcepts
-
Constructor Summary
Constructors Constructor Description IndexedLabelMapToSegmentation(java.lang.String inputFilename, java.lang.String labelFilename, java.lang.String outputFilename, java.lang.String referenceImageFilename, java.lang.String seriesNumber, java.lang.String seriesDescription, java.lang.String contentLabel, java.lang.String contentDescription, java.lang.String contentCreatorName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addAppropriateSegmentedPropertyCategoryCodeSequence(AttributeList list, IndexedLabelMapToSegmentation.LabelInformation labelinfo)
protected java.util.Map<java.lang.Integer,java.lang.Integer>
addSegmentSequence(AttributeList list, java.util.Set<java.lang.Integer> usedLabels, java.util.Map<java.lang.Integer,IndexedLabelMapToSegmentation.LabelInformation> labelMap, java.util.Set<java.lang.Integer> unrecognizedLabels)
protected void
addSegmentSequenceItem(int segmentNumber, SequenceAttribute saSegmentSequence, int index, IndexedLabelMapToSegmentation.LabelInformation labelinfo)
protected void
addSegmentSequenceItem(int segmentNumber, SequenceAttribute saSegmentSequence, IndexedLabelMapToSegmentation.LabelInformation labelinfo)
static void
main(java.lang.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.protected java.util.SortedMap<java.lang.Integer,IndexedLabelMapToSegmentation.LabelInformation>
readLabelMapFile(java.lang.String filename)
protected void
setBit(byte[] pixelData, int f, int r, int c, int rows, int columns)
-
-
-
Field Detail
-
spatialAndRelationalConcepts
protected static final java.util.Set<java.lang.String> spatialAndRelationalConcepts
-
tissueConcepts
protected static final java.util.Set<java.lang.String> tissueConcepts
-
backgroundLabel
protected IndexedLabelMapToSegmentation.LabelInformation backgroundLabel
-
backgroundIndex
protected java.lang.Integer backgroundIndex
-
-
Constructor Detail
-
IndexedLabelMapToSegmentation
public IndexedLabelMapToSegmentation(java.lang.String inputFilename, java.lang.String labelFilename, java.lang.String outputFilename, java.lang.String referenceImageFilename, java.lang.String seriesNumber, java.lang.String seriesDescription, java.lang.String contentLabel, java.lang.String contentDescription, java.lang.String contentCreatorName) throws java.io.IOException, java.lang.NumberFormatException, DicomException
- Throws:
java.io.IOException
java.lang.NumberFormatException
DicomException
-
-
Method Detail
-
readLabelMapFile
protected java.util.SortedMap<java.lang.Integer,IndexedLabelMapToSegmentation.LabelInformation> readLabelMapFile(java.lang.String filename) throws java.io.IOException, java.lang.NumberFormatException
- Throws:
java.io.IOException
java.lang.NumberFormatException
-
addAppropriateSegmentedPropertyCategoryCodeSequence
protected void addAppropriateSegmentedPropertyCategoryCodeSequence(AttributeList list, IndexedLabelMapToSegmentation.LabelInformation labelinfo) throws DicomException
- Throws:
DicomException
-
addSegmentSequenceItem
protected void addSegmentSequenceItem(int segmentNumber, SequenceAttribute saSegmentSequence, int index, IndexedLabelMapToSegmentation.LabelInformation labelinfo) throws DicomException
- Throws:
DicomException
-
addSegmentSequenceItem
protected void addSegmentSequenceItem(int segmentNumber, SequenceAttribute saSegmentSequence, IndexedLabelMapToSegmentation.LabelInformation labelinfo) throws DicomException
- Throws:
DicomException
-
addSegmentSequence
protected java.util.Map<java.lang.Integer,java.lang.Integer> addSegmentSequence(AttributeList list, java.util.Set<java.lang.Integer> usedLabels, java.util.Map<java.lang.Integer,IndexedLabelMapToSegmentation.LabelInformation> labelMap, java.util.Set<java.lang.Integer> unrecognizedLabels) throws DicomException
- Throws:
DicomException
-
setBit
protected void setBit(byte[] pixelData, int f, int r, int c, int rows, int columns)
-
main
public static void main(java.lang.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.
- Parameters:
arg
- four 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
-
-