Package gov.nih.mipav.model.file
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 Summary
Fields Modifier and Type Field Description private VOI[]
addedVOI
DOCUMENT ME!private java.awt.Polygon
contourPolygon
DOCUMENT ME!private short[]
expImgBuffer
DOCUMENT ME!private java.io.File
file
DOCUMENT ME!private java.lang.String
fileName
DOCUMENT ME!private int
fileType
DOCUMENT ME!private short[]
grayScaleArray
DOCUMENT ME!private short
grayScaleNumber
DOCUMENT ME!private ModelImage
image
DOCUMENT ME!private short[]
imgBuffer
DOCUMENT ME!private int
it
DOCUMENT ME!private int
length
DOCUMENT ME!private java.util.BitSet
mask
DOCUMENT ME!private java.util.BitSet
mask2
DOCUMENT ME!private java.util.BitSet
maskAll
DOCUMENT ME!private java.util.BitSet
maskE
DOCUMENT ME!private java.util.BitSet
maskN
DOCUMENT ME!private java.util.BitSet
maskS
DOCUMENT ME!private java.util.BitSet
maskW
DOCUMENT ME!private int
neighbors
DOCUMENT ME!private boolean
newGrayScale
DOCUMENT ME!static int
OVERLAYS
DOCUMENT ME!(package private) ViewJProgressBar
progressBar
DOCUMENT ME!private int
scanPos
DOCUMENT ME!private int
sliceSize
DOCUMENT ME!private int
smallPos
DOCUMENT ME!private int
smallX
DOCUMENT ME!private int
smallY
DOCUMENT ME!static int
STICKS
DOCUMENT ME!private int
testPos
DOCUMENT ME!private int
totalSize
DOCUMENT ME!static int
USERWNDLEVELS
DOCUMENT ME!private int
xDim
DOCUMENT ME!private int
xDimE
DOCUMENT ME!private int
xt
DOCUMENT ME!private int
yDim
DOCUMENT ME!private int
yDimE
DOCUMENT ME!private int
yt
DOCUMENT ME!private int
zDim
DOCUMENT ME!-
Fields inherited from class gov.nih.mipav.model.file.FileBase
BIG_ENDIAN, bitsPerPixel, fileNames, LITTLE_ENDIAN, pBarVisible, raFile, READ, READ_WRITE
-
-
Constructor Summary
Constructors Constructor Description FileCheshireVOI(java.lang.String fileName, java.lang.String fileDir, ModelImage image)
FileCheshireVOI - VOI reader/writer constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VOI[]
readVOI()
readVOI - reads an Cheshire overlay file by reading the overlay information for each different VOI into a different bitmap.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.void
setRegionMaskAll()
DOCUMENT ME!-
Methods inherited from class gov.nih.mipav.model.file.FileBase
addProgressChangeListener, bytesToDouble, bytesToFloat, bytesToInt, bytesToShort, doubleToBytes, finalize, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, floatToBytes, getBufferDouble, getBufferFloat, getBufferInt, getBufferLong, getBufferShort, getBufferUShort, getDataType, getDouble, getFloat, getInt, getLong, getProgressChangeListeners, getRaFile, getSignedShort, getString, getUInt, getUnsignedByte, getUnsignedShort, intToBytes, isBigEndian, isProgressBarVisible, linkProgress, longToBytes, readDouble, readFloat, readInt, readLong, readShort, readString, readUnsignedShort, removeProgressChangeListener, setBigEndian, setBufferFloat, setBufferInt, setBufferLong, setBufferShort, setBufferString, setDataType, setEndianess, shortToBytes, writeBytes, writeDouble, writeFloat, writeInt, writeLong, writeShort
-
-
-
-
Field Detail
-
USERWNDLEVELS
public static final int USERWNDLEVELS
DOCUMENT ME!- See Also:
- Constant Field Values
-
OVERLAYS
public static final int OVERLAYS
DOCUMENT ME!- See Also:
- Constant Field Values
-
STICKS
public static final int STICKS
DOCUMENT ME!- See Also:
- Constant Field Values
-
progressBar
ViewJProgressBar progressBar
DOCUMENT ME!
-
addedVOI
private VOI[] addedVOI
DOCUMENT ME!
-
contourPolygon
private java.awt.Polygon contourPolygon
DOCUMENT ME!
-
expImgBuffer
private short[] expImgBuffer
DOCUMENT ME!
-
file
private java.io.File file
DOCUMENT ME!
-
fileName
private java.lang.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 java.util.BitSet mask
DOCUMENT ME!
-
mask2
private java.util.BitSet mask2
DOCUMENT ME!
-
maskAll
private java.util.BitSet maskAll
DOCUMENT ME!
-
maskE
private java.util.BitSet maskE
DOCUMENT ME!
-
maskN
private java.util.BitSet maskN
DOCUMENT ME!
-
maskS
private java.util.BitSet maskS
DOCUMENT ME!
-
maskW
private java.util.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 Detail
-
FileCheshireVOI
public FileCheshireVOI(java.lang.String fileName, java.lang.String fileDir, ModelImage image) throws java.io.IOException
FileCheshireVOI - VOI reader/writer constructor.- Parameters:
fileName
- file namefileDir
- file directoryimage
- image model: needed during the read process to ensure the VOI "fits" in the image space.- Throws:
java.io.IOException
- if there is an error making the files
-
-
Method Detail
-
readVOI
public VOI[] readVOI() throws java.io.IOException, java.lang.OutOfMemoryError
readVOI - reads an Cheshire overlay file by reading the overlay information for each different VOI into a different bitmap.- Returns:
- DOCUMENT ME!
- Throws:
java.io.IOException
- if there is an error reading the filejava.lang.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 pointyStart
- the y coordinate of the starting pointobjectValue
- the gray scale value of the object
-
setRegionMaskAll
public void setRegionMaskAll()
DOCUMENT ME!
-
-