Package com.pixelmed.apps

# Class ShrinkSegmentationToBoundingBox

java.lang.Object
com.pixelmed.apps.ShrinkSegmentationToBoundingBox

public class ShrinkSegmentationToBoundingBox extends Object

A class of static methods to read DICOM segmentation images, and shrink their extent to the minimum bounding box surrounding the segments.

## Constructor Summary

Constructors
Constructor
Description
`ShrinkSegmentationToBoundingBox(String inputFileName, String outputFileName)`
Read a DICOM segmentation image, and shrink its extent to the minimum bounding box surrounding the segments.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`addTLHCOfClippedRegionToImagePosition(AttributeList list, int[] box)`
`protected void`
`clipAllFramesToSpecifiedSize(AttributeList list, int[] box)`
`protected int[]`
`compute2DInPlaneBoundingBoxForSegments(AttributeList list)`
`protected static int`
`getBit(byte[] pixelData, int f, int r, int c, int rows, int columns)`
`static void`
`main(String[] arg)`
Read a DICOM segmentation image, and shrink its extent to the minimum bounding box surrounding the segments.
`protected 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`

## Constructor Details

### ShrinkSegmentationToBoundingBox

public ShrinkSegmentationToBoundingBox(String inputFileName, String outputFileName) throws DicomException, FileNotFoundException, IOException

Read a DICOM segmentation image, and shrink its extent to the minimum bounding box surrounding the segments.

Parameters:
  `inputFileName` - the input file name
  `outputFileName` - the output file name
Throws:
  `DicomException`
  `FileNotFoundException`
  `IOException`

## Method Details

### addTLHCOfClippedRegionToImagePosition

protected void addTLHCOfClippedRegionToImagePosition(AttributeList list, int[] box) throws DicomException

Throws:
  `DicomException`

### compute2DInPlaneBoundingBoxForSegments

protected int[] compute2DInPlaneBoundingBoxForSegments(AttributeList list) throws DicomException

Throws:
  `DicomException`

### setBit

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

### getBit

protected static int getBit(byte[] pixelData, int f, int r, int c, int rows, int columns)

### clipAllFramesToSpecifiedSize

protected void clipAllFramesToSpecifiedSize(AttributeList list, int[] box) throws DicomException

Throws:
  `DicomException`

### main

public static void main(String[] arg)

Read a DICOM segmentation image, and shrink its extent to the minimum bounding box surrounding the segments.

Parameters:
  `arg` - two parameters, the inputFile, outputFile