Package com.pixelmed.convert

# Class IndexedLabelMapToSegmentation

java.lang.Object
com.pixelmed.convert.IndexedLabelMapToSegmentation

public class IndexedLabelMapToSegmentation extends Object

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`protected class`
`IndexedLabelMapToSegmentation.LabelInformation`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected Integer`
`backgroundIndex`
`protected IndexedLabelMapToSegmentation.LabelInformation`
`backgroundLabel`
`protected static final Set<String>`
`spatialAndRelationalConcepts`
`protected boolean`
`suppressFramesForBackgroundSegment`
`protected static final Set<String>`
`tissueConcepts`

## Constructor Summary

Constructors
Constructor
Description
`IndexedLabelMapToSegmentation(String inputFilename, String labelFilename, String outputFilename, String referenceImageFilename, String seriesNumber, String seriesDescription, String contentLabel, String contentDescription, String contentCreatorName)`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`addAppropriateSegmentedPropertyCategoryCodeSequence(AttributeList list, IndexedLabelMapToSegmentation.LabelInformation labelinfo)`
`protected Map<Integer,Integer>`
`addSegmentSequence(AttributeList list, Set<Integer> usedLabels, Map<Integer,IndexedLabelMapToSegmentation.LabelInformation> labelMap, Set<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(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 SortedMap<Integer,IndexedLabelMapToSegmentation.LabelInformation>`
`readLabelMapFile(String filename)`
`static void`
`setBit(byte[] pixelData, int f, int r, int c, int rows, int columns)`

### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### suppressFramesForBackgroundSegment

protected boolean suppressFramesForBackgroundSegment

### spatialAndRelationalConcepts

protected static final Set<String> spatialAndRelationalConcepts

### tissueConcepts

protected static final Set<String> tissueConcepts

### backgroundLabel

protected IndexedLabelMapToSegmentation.LabelInformation backgroundLabel

### backgroundIndex

protected Integer backgroundIndex

## Constructor Details

### IndexedLabelMapToSegmentation

public IndexedLabelMapToSegmentation(String inputFilename, String labelFilename, String outputFilename, String referenceImageFilename, String seriesNumber, String seriesDescription, String contentLabel, String contentDescription, String contentCreatorName) throws IOException, NumberFormatException, DicomException

Throws:
  `IOException`
  `NumberFormatException`
  `DicomException`

## Method Details

### readLabelMapFile

protected SortedMap<Integer,IndexedLabelMapToSegmentation.LabelInformation> readLabelMapFile(String filename) throws IOException, NumberFormatException

Throws:
  `IOException`
  `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 Map<Integer,Integer> addSegmentSequence(AttributeList list, Set<Integer> usedLabels, Map<Integer,IndexedLabelMapToSegmentation.LabelInformation> labelMap, Set<Integer> unrecognizedLabels) throws DicomException

Throws:
  `DicomException`

### setBit

public static void setBit(byte[] pixelData, int f, int r, int c, int rows, int columns)

### main

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.

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