Package com.pixelmed.apps

## Class ShrinkSegmentationToBoundingBox

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

-     public class ShrinkSegmentationToBoundingBox
      extends java.lang.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​(java.lang.String inputFileName, java.lang.String outputFileName)` | Read a DICOM segmentation image, and shrink its extent to the minimum bounding box surrounding the segments.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    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​(java.lang.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 Detail

    - #### ShrinkSegmentationToBoundingBox

          public ShrinkSegmentationToBoundingBox​(java.lang.String inputFileName,
                                                 java.lang.String outputFileName)
                                          throws DicomException,
                                                 java.io.FileNotFoundException,
                                                 java.io.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`
        `java.io.FileNotFoundException`
        `java.io.IOException`

  - ### Method Detail

    - #### 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​(java.lang.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