Package com.pixelmed.dicom

## Class TiledFramesIndex

- java.lang.Object
- - com.pixelmed.dicom.TiledFramesIndex

-     public class TiledFramesIndex
      extends java.lang.Object

  The `TiledFramesIndex` class ... .

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected int[]` | `columnForFrame` |
    `protected int[][]` | `index` |
    `protected boolean` | `isEncodedInStandardRasterOrder` |
    `protected boolean` | `isEncodedInStandardRasterOrderHasBeenTested` |
    `protected boolean` | `isSparse` |
    `protected boolean` | `isSparseHasBeenTested` |
    `protected int` | `numberOfColumnsOfTiles` |
    `protected int` | `numberOfFrames` |
    `protected int` | `numberOfRowsOfTiles` |
    `protected int[]` | `rowForFrame` |
    `protected double` | `totalPixelMatrixXOffsetInSlideCoordinateSystem` |
    `protected double` | `totalPixelMatrixYOffsetInSlideCoordinateSystem` |
    `protected double[][]` | `xOffsetInSlideCoordinateSystem` |
    `protected double[][]` | `yOffsetInSlideCoordinateSystem` |
    `protected double[][]` | `zOffsetInSlideCoordinateSystem` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `TiledFramesIndex​(AttributeList list)` | Index the tiles by row and column position
    `TiledFramesIndex​(AttributeList list, boolean extractPhysicalOffsets, boolean buildInverseIndex, boolean ignorePlanePosition)` | Index the tiles by row and column position
    `TiledFramesIndex​(AttributeList list, boolean extractPhysicalOffsets, boolean buildInverseIndex, boolean ignorePlanePosition, boolean checkPhysicalOffsets, double checkPhysicalOffsetPixelSpacingRelativeThreshold)` | Index the tiles by row and column position

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `computeRowAndColumnForFrame()` |
    `int` | `getColumn​(int frame)` | Get the column number for the specified frame
    `int` | `getFrameNumber​(int row, int column)` | Get the frame number for the tile at the specified row and column
    `int` | `getNumberOfColumnsOfTiles()` |
    `int` | `getNumberOfRowsOfTiles()` |
    `int` | `getRow​(int frame)` | Get the row number for the specified frame
    `boolean` | `isEncodedInStandardRasterOrder()` | Is the encoded matrix of tiles organized in a standard raster pattern?
    `boolean` | `isSparse()` | Is the encoded matrix of tiles sparse?
    `static void` | `main​(java.lang.String[] arg)` | Read the DICOM input file as a list of attributes, create and index of the tiled frames, and dump it.
    `java.lang.String` | `toString()` | Dump the contents of the index as a human-readable string.

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

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

- - ### Field Detail

    - #### index

          protected int[][] index

    - #### xOffsetInSlideCoordinateSystem

          protected double[][] xOffsetInSlideCoordinateSystem

    - #### yOffsetInSlideCoordinateSystem

          protected double[][] yOffsetInSlideCoordinateSystem

    - #### zOffsetInSlideCoordinateSystem

          protected double[][] zOffsetInSlideCoordinateSystem

    - #### numberOfColumnsOfTiles

          protected int numberOfColumnsOfTiles

    - #### numberOfRowsOfTiles

          protected int numberOfRowsOfTiles

    - #### numberOfFrames

          protected int numberOfFrames

    - #### totalPixelMatrixXOffsetInSlideCoordinateSystem

          protected double totalPixelMatrixXOffsetInSlideCoordinateSystem

    - #### totalPixelMatrixYOffsetInSlideCoordinateSystem

          protected double totalPixelMatrixYOffsetInSlideCoordinateSystem

    - #### rowForFrame

          protected int[] rowForFrame

    - #### columnForFrame

          protected int[] columnForFrame

    - #### isSparse

          protected boolean isSparse

    - #### isSparseHasBeenTested

          protected boolean isSparseHasBeenTested

    - #### isEncodedInStandardRasterOrder

          protected boolean isEncodedInStandardRasterOrder

    - #### isEncodedInStandardRasterOrderHasBeenTested

          protected boolean isEncodedInStandardRasterOrderHasBeenTested

  - ### Constructor Detail

    - #### TiledFramesIndex

          public TiledFramesIndex​(AttributeList list,
                                  boolean extractPhysicalOffsets,
                                  boolean buildInverseIndex,
                                  boolean ignorePlanePosition)
                           throws DicomException

      Index the tiles by row and column position

      Parameters:
        `list` - an AttributeList for a Whole Slide Image
        `extractPhysicalOffsets` - extract the physical as well as logical position
        `buildInverseIndex` - build the inverse index rather than waiting until it is needed
        `ignorePlanePosition` - ignore the PlanePositionSequence and assume frame order is normal raster
      Throws:
        `DicomException` - if insufficient or inconsistent information

    - #### TiledFramesIndex

          public TiledFramesIndex​(AttributeList list,
                                  boolean extractPhysicalOffsets,
                                  boolean buildInverseIndex,
                                  boolean ignorePlanePosition,
                                  boolean checkPhysicalOffsets,
                                  double checkPhysicalOffsetPixelSpacingRelativeThreshold)
                           throws DicomException

      Index the tiles by row and column position

      Parameters:
        `list` - an AttributeList for a Whole Slide Image
        `extractPhysicalOffsets` - extract the physical as well as logical position
        `buildInverseIndex` - build the inverse index rather than waiting until it is needed
        `ignorePlanePosition` - ignore the PlanePositionSequence and assume frame order is normal raster
        `checkPhysicalOffsets` - check that the physical offsets match what is predicted from the origin, logical position and spacing
        `checkPhysicalOffsetPixelSpacingRelativeThreshold` - threshold as fraction of pixel spacing for match
      Throws:
        `DicomException` - if insufficient or inconsistent information

    - #### TiledFramesIndex

          public TiledFramesIndex​(AttributeList list)
                           throws DicomException

      Index the tiles by row and column position

      Parameters:
        `list` - an AttributeList for a Whole Slide Image
      Throws:
        `DicomException` - if insufficient or inconsistent information

  - ### Method Detail

    - #### getNumberOfColumnsOfTiles

          public int getNumberOfColumnsOfTiles()

    - #### getNumberOfRowsOfTiles

          public int getNumberOfRowsOfTiles()

    - #### getFrameNumber

          public int getFrameNumber​(int row,
                                    int column)

      Get the frame number for the tile at the specified row and column

      Parameters:
        `row` - the number of the tile along the column direction (which row of tiles), numbered from 0
        `column` - the number of the tile along the row direction (which column of tiles), numbered from 0
      Returns:
        the frame number from 1, or 0 if no frame
      Throws:
        `java.lang.ArrayIndexOutOfBoundsException` - if row or column beyond limits of tile array

    - #### computeRowAndColumnForFrame

          protected void computeRowAndColumnForFrame()

    - #### getRow

          public int getRow​(int frame)

      Get the row number for the specified frame

      Parameters:
        `frame` - the frame number from 1
      Returns:
        row the number of the tile along the column direction (which row of tiles), numbered from 0
      Throws:
        `java.lang.ArrayIndexOutOfBoundsException` - if frame number is beyond limits of tile array

    - #### getColumn

          public int getColumn​(int frame)

      Get the column number for the specified frame

      Parameters:
        `frame` - the frame number from 1
      Returns:
        column the number of the tile along the row direction (which column of tiles), numbered from 0
      Throws:
        `java.lang.ArrayIndexOutOfBoundsException` - if frame number is beyond limits of tile array

    - #### isSparse

          public boolean isSparse()

      Is the encoded matrix of tiles sparse?

      Returns:
        true if any tile position does not have an encoded frame

    - #### isEncodedInStandardRasterOrder

          public boolean isEncodedInStandardRasterOrder()

      Is the encoded matrix of tiles organized in a standard raster pattern?

      The standard pattern is all the columns of the first row from left to right, then the second row, etc.

      Returns:
        true if in the standard raster order

    - #### toString

          public java.lang.String toString()

      Dump the contents of the index as a human-readable string.

      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        the string

    - #### main

          public static void main​(java.lang.String[] arg)

      Read the DICOM input file as a list of attributes, create and index of the tiled frames, and dump it.

      Parameters:
        `arg` - array of one string (the filename to read and dump),