Class FileCheshireVOI

java.lang.Object
gov.nih.mipav.model.file.FileBase
gov.nih.mipav.model.file.FileCheshireVOI

public class FileCheshireVOI extends FileBase
Addresses and lengths are always contained in 4 bytes. The first 4 bytes plus 4 give the location of ascii text saying UserWndLevels, overlays, or sticks if overlays are present. The same region of interest in the same slice may be saved with exactly the same contour using 2 different bounding boxes. The first 90 bytes are header bytes. Location 0x24 may give a location to the start of information for a given slice. The first 4 bytes of this slice information will give the location of the start of information for another slice. This will continue until the first 4 bytes of a slice contains 0x28. 0x28 contains 0. If 0x24 does not point to the start of slice information, then it contains 0x28. However, the code collecting slice information from 0x24 was commented out since it produced a contour in slice 15 in 10080-2-dwi-bo-sw.oly that was not seen in Cheshire. With UserWndLevels 0x8C gives the start of a slice of information and the first 4 bytes of the information slice give the start of another slice until finally 1 slice starts with 0. With overlays and sticks an information slice starts 24 bytes after overlays. This 1 information slice was different from other information slices in that the first 8 bytes had the locations of 2 information slices instead of just 4 bytes for 1 location like the other information slices. Also note that information slices may be fragmentary - they may not contain all the information promised by length bytes. In these cases just ignore the fragments of the information slices.
  • Field Details

    • USERWNDLEVELS

      public static final int USERWNDLEVELS
      DOCUMENT ME!
      See Also:
    • OVERLAYS

      public static final int OVERLAYS
      DOCUMENT ME!
      See Also:
    • STICKS

      public static final int STICKS
      DOCUMENT ME!
      See Also:
    • progressBar

      ViewJProgressBar progressBar
      DOCUMENT ME!
    • addedVOI

      private VOI[] addedVOI
      DOCUMENT ME!
    • contourPolygon

      private Polygon contourPolygon
      DOCUMENT ME!
    • expImgBuffer

      private short[] expImgBuffer
      DOCUMENT ME!
    • file

      private File file
      DOCUMENT ME!
    • fileName

      private String fileName
      DOCUMENT ME!
    • fileType

      private int fileType
      DOCUMENT ME!
    • grayScaleArray

      private short[] grayScaleArray
      DOCUMENT ME!
    • grayScaleNumber

      private short grayScaleNumber
      DOCUMENT ME!
    • image

      private ModelImage image
      DOCUMENT ME!
    • imgBuffer

      private short[] imgBuffer
      DOCUMENT ME!
    • length

      private int length
      DOCUMENT ME!
    • mask

      private BitSet mask
      DOCUMENT ME!
    • mask2

      private BitSet mask2
      DOCUMENT ME!
    • maskAll

      private BitSet maskAll
      DOCUMENT ME!
    • maskE

      private BitSet maskE
      DOCUMENT ME!
    • maskN

      private BitSet maskN
      DOCUMENT ME!
    • maskS

      private BitSet maskS
      DOCUMENT ME!
    • maskW

      private BitSet maskW
      DOCUMENT ME!
    • neighbors

      private int neighbors
      DOCUMENT ME!
    • newGrayScale

      private boolean newGrayScale
      DOCUMENT ME!
    • scanPos

      private int scanPos
      DOCUMENT ME!
    • sliceSize

      private int sliceSize
      DOCUMENT ME!
    • smallPos

      private int smallPos
      DOCUMENT ME!
    • smallX

      private int smallX
      DOCUMENT ME!
    • smallY

      private int smallY
      DOCUMENT ME!
    • testPos

      private int testPos
      DOCUMENT ME!
    • totalSize

      private int totalSize
      DOCUMENT ME!
    • xDim

      private int xDim
      DOCUMENT ME!
    • yDim

      private int yDim
      DOCUMENT ME!
    • zDim

      private int zDim
      DOCUMENT ME!
    • xDimE

      private int xDimE
      DOCUMENT ME!
    • xt

      private int xt
      DOCUMENT ME!
    • yt

      private int yt
      DOCUMENT ME!
    • it

      private int it
      DOCUMENT ME!
    • yDimE

      private int yDimE
      DOCUMENT ME!
  • Constructor Details

    • FileCheshireVOI

      public FileCheshireVOI(String fileName, String fileDir, ModelImage image) throws IOException
      FileCheshireVOI - VOI reader/writer constructor.
      Parameters:
      fileName - file name
      fileDir - file directory
      image - image model: needed during the read process to ensure the VOI "fits" in the image space.
      Throws:
      IOException - if there is an error making the files
  • Method Details

    • readVOI

      public VOI[] readVOI() throws IOException, OutOfMemoryError
      readVOI - reads an Cheshire overlay file by reading the overlay information for each different VOI into a different bitmap.
      Returns:
      DOCUMENT ME!
      Throws:
      IOException - if there is an error reading the file
      OutOfMemoryError - DOCUMENT ME!
    • setRegionMask

      public void setRegionMask(int xStart, int yStart, short objectValue)
      setRegionMask set the mask of all points in the 4 connected region with a gray scale value of objectValue.
      Parameters:
      xStart - the x coordinate of the starting point
      yStart - the y coordinate of the starting point
      objectValue - the gray scale value of the object
    • setRegionMaskAll

      public void setRegionMaskAll()
      DOCUMENT ME!