Package gov.nih.mipav.model.file
Class FilePARREC
java.lang.Object
gov.nih.mipav.model.file.FileBase
gov.nih.mipav.model.file.FilePARREC
The class reads and writes PAR/REC files.
A right handed coordinate system is used with the positive axis pointing (Anterior/Posterior)A->P, (Foot/Head)F->H,
and (Right/Left)R->L.
* Updated September 16, 2011 by Beth Tyrie
// This explains the derivation of the dicom transformation matrix and origin from the PARREC parameters.
// The axial PAR file is KKZ_130213_4_1.PAR
// The first slice of the axial dicom file is 20131023203338769.MR.dcm
// The sagittal PAR file is KKZ_130213_3_1.PAR
// The first slice of the sagittal dicom file is 20131107105801812.MR.dcm.
// The coronal PAR file is KKZ_130213_10_1.PAR
// The first slice of the coronal dicom file is 20131107105805315.MR.dcm.
// The angles are the same for the header volume parameters and for every slice
int ori;
final int axial = 1;
final int sagittal = 2;
final int coronal = 3;
ori = coronal;
double angulation_rl = 0.0;
double angulation_ap = 0.0;
double angulation_fh = 0.0;
switch(ori) {
case axial:
angulation_rl = -8.700;
angulation_ap = -4.865;
angulation_fh = 3.364;
break;
case sagittal:
angulation_rl = 0.305;
angulation_ap = -4.280;
angulation_fh = 4.083;
break;
case coronal:
angulation_rl = 3.931;
angulation_ap = -4.031;
angulation_fh = 4.346;
}
double angX = 0.0;
double angY = 0.0;
double angZ = 0.0;
switch(ori) {
case axial:
angX = angulation_rl;
angY = angulation_ap;
angZ = angulation_fh;
break;
case sagittal:
angX = angulation_ap;
angY = -angulation_fh;
angZ = -angulation_rl;
break;
case coronal:
angX = angulation_rl;
angY = -angulation_fh;
angZ = angulation_ap;
}
double Sx = Math.sin(angX * Math.PI/180.0);
double Sy = Math.sin(angY * Math.PI/180.0);
double Sz = Math.sin(angZ * Math.PI/180.0);
double Cx = Math.cos(angX * Math.PI/180.0);
double Cy = Math.cos(angY * Math.PI/180.0);
double Cz = Math.cos(angZ * Math.PI/180.0);
// EulerOrder = ORDER_XYZ;
// This is the Transformation matrix shown in the dicom header
// The dicom transformation matrix or image.getMatrix() is the transpose of the matrix given by getPatientOrientation().
// image.getMatrix() and getPatientOrientation() contain just the rotation component.
double m00=Cy*Cz;
double m01=-Cy*Sz;
double m02=Sy;
double m10=Cz*Sx*Sy+Cx*Sz;
double m11=Cx*Cz-Sx*Sy*Sz;
double m12=-Cy*Sx;
double m20=-Cx*Cz*Sy+Sx*Sz;
double m21=Cz*Sx+Cx*Sy*Sz;
double m22=Cx*Cy;
TransMatrix tr = new TransMatrix(4);
switch (ori) {
case axial:
tr.M00 = (float)m00;
tr.M01 = (float)m01;
tr.M02 = (float)m02;
tr.M03 = 0;
tr.M10 = (float)m10;
tr.M11 = (float)m11;
tr.M12 = (float)m12;
tr.M13 = 0;
tr.M20 = (float)m20;
tr.M21 = (float)m21;
tr.M22 = (float)m22;
tr.M23 = 0;
tr.M30 = 0;
tr.M31 = 0;
tr.M32 = 0;
tr.M33 = 1;
break;
case sagittal:
tr.M00 = -(float)m20;
tr.M01 = -(float)m21;
tr.M02 = -(float)m22;
tr.M03 = 0;
tr.M10 = (float)m00;
tr.M11 = (float)m01;
tr.M12 = (float)m02;
tr.M13 = 0;
tr.M20 = -(float)m10;
tr.M21 = -(float)m11;
tr.M22 = -(float)m12;
tr.M23 = 0;
tr.M30 = 0;
tr.M31 = 0;
tr.M32 = 0;
tr.M33 = 1;
break;
case coronal:
tr.M00 = (float)m00;
tr.M01 = (float)m01;
tr.M02 = (float)m02;
tr.M03 = 0;
tr.M10 = (float)m20;
tr.M11 = (float)m21;
tr.M12 = (float)m22;
tr.M13 = 0;
tr.M20 = -(float)m10;
tr.M21 = -(float)m11;
tr.M22 = -(float)m12;
tr.M23 = 0;
tr.M30 = 0;
tr.M31 = 0;
tr.M32 = 0;
tr.M33 = 1;
}
System.out.println("image transMatrix = " + tr);
double resX = 0.0;
double resY = 0.0;
double resZ = 0.0;
switch(ori) {
case axial:
resX = 0.859375;
resY = 0.859375;
resZ = 1.0;
break;
case sagittal:
resX = 0.42857143;
resY = 0.42857143;
resZ = 5.0;
break;
case coronal:
resX = 0.3515625;
resY = 0.3515625;
resZ = 3.3;
}
// The header volume offsets and the individual slice offsets are all different
// The header volume offsets correspond to (xDim - 1)/2, (yDim - 1)/2, (zDim - 1)/2
// The slice offsets correspond to (xDim - 1)/2, (yDim - 1)/2, zSlice.
double rl_offset_center = 0.0;
double ap_offset_center = 0.0;
double fh_offset_center = 0.0;
switch(ori) {
case axial:
rl_offset_center = 6.655;
ap_offset_center = 3.537;
fh_offset_center = 22.171;
break;
case sagittal:
rl_offset_center = 8.844;
ap_offset_center = -3.225;
fh_offset_center = -0.535;
break;
case coronal:
rl_offset_center = 6.147;
ap_offset_center = 16.846;
fh_offset_center = 16.330;
}
double offsetX = 0.0;
double offsetY = 0.0;
double offsetZ = 0.0;
switch(ori) {
case axial:
offsetX = rl_offset_center;
offsetY = ap_offset_center;
offsetZ = fh_offset_center;
break;
case sagittal:
offsetX = ap_offset_center;
offsetY = -fh_offset_center;
offsetZ = -rl_offset_center;
break;
case coronal:
offsetX = rl_offset_center;
offsetY = -fh_offset_center;
offsetZ = ap_offset_center;
}
double dimX = 0.0;
double dimY = 0.0;
double dimZ = 0.0;
switch(ori) {
case axial:
dimX = 256;
dimY = 256;
dimZ = 140;
break;
case sagittal:
dimX = 560;
dimY = 560;
dimZ = 31;
case coronal:
dimX = 512;
dimY = 512;
dimZ = 47;
}
double originX = offsetX - m00 * resX * (dimX-1)/2 - m01 * resY * (dimY-1)/2- m02 * resZ * (dimZ-1)/2;
double originY = offsetY - m10 * resX * (dimX-1)/2 - m11 * resY * (dimY-1)/2 - m12 * resZ * (dimZ-1)/2;
double originZ = offsetZ - m20 * resX * (dimX-1)/2 - m21 * resY * (dimY-1)/2 - m22 * resZ * (dimZ-1)/2;
if (ori == sagittal) {
originY = -originY;
originZ = -originZ;
}
else if (ori == coronal) {
originY = -originY;
}
// These are the origins shown for dicom slice 0
System.out.println("originX = " + originX);
System.out.println("originY = " + originY);
System.out.println("originZ = " + originZ);
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate intbFactorIndexprivate int[]private intprivate intprivate int[]private intprivate int(package private) booleanprivate String[]private intprivate intprivate String[]private float[]private intprivate intprivate intprivate intprivate float[]private intprivate intprivate String[]private intprivate intprivate float[]private intprivate intprivate String[]private intprivate intprivate String[]private intprivate intprivate intcounterprivate float[][]private String[]private intprivate intprivate float[]private int[]private intprivate intprivate DTIParametersObject to save DWI paramters toprivate float[]private intprivate intprivate int[]private intprivate intprivate int[]private intprivate intprivate float[]private intprivate intprivate Stringexam nameprivate StringFile directory of the image.private FileInfoPARRECReference to the file info. for an Analyze headerprivate FileInfoPARREC[]private StringFile name of the image.private float[]private intprivate intprivate int[]private intprivate intprivate Stringprivate int[]private intprivate intprivate intprivate intbFactorIndexstatic final String[]The extensions of ANALYZE file.private ModelImageThe image read in from the file.private float[][]private intprivate intprivate float[][]private intprivate intprivate int[]private intprivate intprivate int[]private intprivate intstatic final String[]private float[]private intprivate intprivate booleannormal par/rec are sorted by volumes...sometime, they are not sorted like this...instead they are based on slices if that is true, then we need to change around the image dataarray to make it sorted by volumesprivate int[]private intprivate intprivate int[]private intprivate intprivate int[]private intprivate intprivate int[]private intprivate intprivate intnum slices per volumeprivate intnum vols in 4d datasetprivate intprivate FileInfoPARRECfile infoprivate Stringprivate Stringpatient positionprivate Stringprotocol nameprivate float[]floating point value = raw value/scaleSlope + rescaleIntercept/(rescaleSlope*scaleSlope)private float[]private booleanTrue if the 3 values are the same for all slicesprivate float[]private int[]private intprivate intprivate int[]private intprivate intslice mapprivate intprivate intslice parametersslicesprivate float[]private intprivate intprivate int[]private intprivate intprivate Stringversionvol mapvol parametersprivate floatVoxel offset tag used to read in the image.private int[]private intprivate intprivate int[]private intprivate intFields inherited from class gov.nih.mipav.model.file.FileBase
BIG_ENDIAN, bitsPerPixel, fileNames, LITTLE_ENDIAN, pBarVisible, raFile, READ, READ_WRITE -
Constructor Summary
ConstructorsConstructorDescriptionFilePARREC(String[] fileNames) Creates a new FileAnalyze object.FilePARREC(String fName, String fDir) Constructs new file object.FilePARREC(String fileName, String fileDirectory, FileInfoBase fileInfo) Constructor used by FileIO to write an imageFilePARREC(String fileName, String fileDirectory, FileInfoPARREC[] fileInfoArray, boolean changeToUnsignedInts) Constructor used by FileIO to write an image -
Method Summary
Modifier and TypeMethodDescriptionstatic TransMatrixConverts translation matrix to mipav specific formatDOCUMENT ME!voidfinalize()Prepares this class for cleanup.static String[]getCompleteFileNameList(String absolutePath) Returns the complete list of file names according to given file name.String[]getCompleteFileNameListDefault(String absolutePath) Gets the header and image file names given a header or image file nameReturns the FileInfoAnalyze read from the file.invalid input: '<'invalid input: '<'invalid input: '<'invalid input: '<'invalid input: '<'invalid input: '<'invalid input: '<' .working Returns the header file.static StringgetHeaderFile(String[] fileNames) ======= Returns the header file.String[]Returns the image file list.static String[]getImageFiles(String[] fileNames) Returns the image file list.private intgetOffset(FileInfoPARREC fileInfo) Helper method to calculate the offset for getting only the middle analyze image slice from the 3D file.static booleanisHeaderFile(String absolutePath) Return true if the file specified by absolutePath is header file of PARREC.static booleanisImageFile(String absolutePath) Return true if the file specified by absolutePath is image file of PARREC.static TransMatrixmakeRotationMatrix(int[] size, double[] rotations) Makes rotation matrix based on image angulations that were stored in header and converted to orientation-specific values.static TransMatrixmakeTranslationMatrix(double[] translations) Makes rotation matrix based on image off-centres that were stored in header and converted to orientation-specific values.booleanreadHeader(String imageFileName, String fileDir) Reads the analyze header and stores the information in fileInfo.readImage(boolean one) Reads an PAR/REC image file by reading the header then making a FileRaw to read the image for all filenames in the file list.voidreadImage(float[] buffer) Reads in a PAR/REC image (first the header file, then the raw file)voidsetImage(ModelImage image) private voidupdateStartLocations(FileInfoBase[] fileInfo) Updates the start locations.private voidupdateTransformMatrix(FileInfoPARREC fileInfo, ModelImage image) private voidupdateUnitsOfMeasure(FileInfoPARREC fileInfo, ModelImage image) Updates the units of Measure in the file info based on the voxUnits from an Analyze Header.voidwriteHeader(ModelImage writeImage, String headerFileName, int beginSlice, int endSlice, int beginTime, int endTime, boolean rescale) voidwriteImage(ModelImage image, FileWriteOptions options) Writes a PAR/REC format image and header.Methods inherited from class gov.nih.mipav.model.file.FileBase
addProgressChangeListener, bytesToDouble, bytesToFloat, bytesToInt, bytesToShort, doubleToBytes, 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 Details
-
hdrEXTENSIONS
The extensions of ANALYZE file. -
imgEXTENSIONS
-
fileDir
File directory of the image. -
fileInfo
Reference to the file info. for an Analyze header -
fileName
File name of the image. -
image
The image read in from the file. -
dtiparams
Object to save DWI paramters to -
vox_offset
private float vox_offsetVoxel offset tag used to read in the image. -
fileInfoArray
-
outInfo
file info -
VolMap
vol map -
SliceMap
slice map -
VolParameters
vol parameters -
SliceParameters
slice parameters -
Slices
slices -
version
version -
patientName
-
examName
exam name -
protocolName
protocol name -
patientPosition
patient position -
foldover
-
sliceOrientPos
private int sliceOrientPos -
bValuePos
private int bValuePosbFactorIndex -
gradPos
private int gradPosbFactorIndex -
echoNumberPos
private int echoNumberPos -
dynamicScanNumberPos
private int dynamicScanNumberPos -
cardiacPhaseNumberPos
private int cardiacPhaseNumberPos -
imageTypeMRPos
private int imageTypeMRPos -
scanningSequencePos
private int scanningSequencePos -
scanPercentagePos
private int scanPercentagePos -
windowCenterPos
private int windowCenterPos -
windowWidthPos
private int windowWidthPos -
imageAngulationPos
private int imageAngulationPos -
imageOffcentrePos
private int imageOffcentrePos -
fmriStatusIndicationPos
private int fmriStatusIndicationPos -
imageTypeEDESPos
private int imageTypeEDESPos -
echoTimePos
private int echoTimePos -
dynamicScanBeginTimePos
private int dynamicScanBeginTimePos -
triggerTimePos
private int triggerTimePos -
numberOfAveragesPos
private int numberOfAveragesPos -
flipAnglePos
private int flipAnglePos -
cardiacFrequencyPos
private int cardiacFrequencyPos -
minimumRRIntervalPos
private int minimumRRIntervalPos -
maximumRRIntervalPos
private int maximumRRIntervalPos -
turboFactorPos
private int turboFactorPos -
inversionDelayPos
private int inversionDelayPos -
diffusionBValueNumberPos
private int diffusionBValueNumberPos -
gradientOrientationNumberPos
private int gradientOrientationNumberPos -
contrastTypePos
private int contrastTypePos -
diffusionAnisotropyTypePos
private int diffusionAnisotropyTypePos -
labelTypePos
private int labelTypePos -
contrastBolusAgentPos
private int contrastBolusAgentPos -
contrastBolusRoutePos
private int contrastBolusRoutePos -
contrastBolusVolumePos
private int contrastBolusVolumePos -
contrastBolusStartTimePos
private int contrastBolusStartTimePos -
contrastBolusTotalDosePos
private int contrastBolusTotalDosePos -
contrastBolusIngredientPos
private int contrastBolusIngredientPos -
contrastBolusIngredientConcentrationPos
private int contrastBolusIngredientConcentrationPos -
sliceOrientIndex
private int sliceOrientIndex -
bValueIndex
private int bValueIndex -
gradIndex
private int gradIndex -
echoNumberIndex
private int echoNumberIndex -
dynamicScanNumberIndex
private int dynamicScanNumberIndex -
cardiacPhaseNumberIndex
private int cardiacPhaseNumberIndex -
imageTypeMRIndex
private int imageTypeMRIndex -
scanningSequenceIndex
private int scanningSequenceIndex -
scanPercentageIndex
private int scanPercentageIndex -
windowCenterIndex
private int windowCenterIndex -
windowWidthIndex
private int windowWidthIndex -
imageAngulationIndex
private int imageAngulationIndex -
imageOffcentreIndex
private int imageOffcentreIndex -
fmriStatusIndicationIndex
private int fmriStatusIndicationIndex -
imageTypeEDESIndex
private int imageTypeEDESIndex -
echoTimeIndex
private int echoTimeIndex -
dynamicScanBeginTimeIndex
private int dynamicScanBeginTimeIndex -
triggerTimeIndex
private int triggerTimeIndex -
numberOfAveragesIndex
private int numberOfAveragesIndex -
flipAngleIndex
private int flipAngleIndex -
cardiacFrequencyIndex
private int cardiacFrequencyIndex -
minimumRRIntervalIndex
private int minimumRRIntervalIndex -
maximumRRIntervalIndex
private int maximumRRIntervalIndex -
turboFactorIndex
private int turboFactorIndex -
inversionDelayIndex
private int inversionDelayIndex -
diffusionBValueNumberIndex
private int diffusionBValueNumberIndex -
gradientOrientationNumberIndex
private int gradientOrientationNumberIndex -
contrastTypeIndex
private int contrastTypeIndex -
diffusionAnisotropyTypeIndex
private int diffusionAnisotropyTypeIndex -
labelTypeIndex
private int labelTypeIndex -
contrastBolusAgentIndex
private int contrastBolusAgentIndex -
contrastBolusRouteIndex
private int contrastBolusRouteIndex -
contrastBolusVolumeIndex
private int contrastBolusVolumeIndex -
contrastBolusStartTimeIndex
private int contrastBolusStartTimeIndex -
contrastBolusTotalDoseIndex
private int contrastBolusTotalDoseIndex -
contrastBolusIngredientIndex
private int contrastBolusIngredientIndex -
contrastBolusIngredientConcentrationIndex
private int contrastBolusIngredientConcentrationIndex -
echoNumber
private int[] echoNumber -
dynamicScanNumber
private int[] dynamicScanNumber -
cardiacPhaseNumber
private int[] cardiacPhaseNumber -
imageTypeMR
private int[] imageTypeMR -
scanningSequence
private int[] scanningSequence -
scanPercentage
private int[] scanPercentage -
windowCenter
private int[] windowCenter -
windowWidth
private int[] windowWidth -
imageAngulation
private float[][] imageAngulation -
imageOffcentre
private float[][] imageOffcentre -
fmriStatusIndication
private int[] fmriStatusIndication -
imageTypeEDES
private int[] imageTypeEDES -
echoTime
private float[] echoTime -
dynamicScanBeginTime
private float[] dynamicScanBeginTime -
triggerTime
private float[] triggerTime -
numberOfAverages
private int[] numberOfAverages -
flipAngle
private float[] flipAngle -
cardiacFrequency
private int[] cardiacFrequency -
minimumRRInterval
private int[] minimumRRInterval -
maximumRRInterval
private int[] maximumRRInterval -
turboFactor
private int[] turboFactor -
inversionDelay
private float[] inversionDelay -
diffusionBFactor
private float[] diffusionBFactor -
diffusionBValueNumber
private int[] diffusionBValueNumber -
gradientOrientationNumber
private int[] gradientOrientationNumber -
contrastType
-
diffusionAnisotropyType
-
diffusion
private float[][] diffusion -
labelType
private int[] labelType -
contrastBolusAgent
-
contrastBolusRoute
private float[] contrastBolusRoute -
contrastBolusVolume
-
contrastBolusStartTime
-
contrastBolusTotalDose
private float[] contrastBolusTotalDose -
contrastBolusIngredient
-
contrastBolusIngredientConcentration
private float[] contrastBolusIngredientConcentration -
counter
private int countercounter -
rescaleIntercept
private float[] rescaleInterceptfloating point value = raw value/scaleSlope + rescaleIntercept/(rescaleSlope*scaleSlope) -
rescaleSlope
private float[] rescaleSlope -
scaleSlope
private float[] scaleSlope -
sameSliceScalings
private boolean sameSliceScalingsTrue if the 3 values are the same for all slices -
originalDataType
private int originalDataType -
isSortedByVolumes
private boolean isSortedByVolumesnormal par/rec are sorted by volumes...sometime, they are not sorted like this...instead they are based on slices if that is true, then we need to change around the image dataarray to make it sorted by volumes -
numSlices
private int numSlicesnum slices per volume -
numVolumes
private int numVolumesnum vols in 4d dataset -
changeToUnsignedInts
boolean changeToUnsignedInts
-
-
Constructor Details
-
FilePARREC
Creates a new FileAnalyze object.- Parameters:
fileNames- DOCUMENT ME!
-
FilePARREC
Constructs new file object.- Parameters:
fName- File name.fDir- File directory.
-
FilePARREC
public FilePARREC(String fileName, String fileDirectory, FileInfoPARREC[] fileInfoArray, boolean changeToUnsignedInts) Constructor used by FileIO to write an image- Parameters:
fileName-fileDirectory-changeToUnsignedInts-fileInfoPARREC- []
-
FilePARREC
Constructor used by FileIO to write an image- Parameters:
fileName-fileDirectory-fileInfo-
-
-
Method Details
-
finalize
public void finalize()Prepares this class for cleanup. Calls thefinalizemethod for existing elements, closes any open files and sets other elements tonull. -
setImage
- Parameters:
image-
-
getCompleteFileNameList
Returns the complete list of file names according to given file name.- Parameters:
absolutePath- one file name of PARREC.- Returns:
- the complete list of file names.
-
getHeaderFile
======= Returns the header file.- Parameters:
fileNames- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getImageFiles
Returns the image file list.- Parameters:
fileNames- DOCUMENT ME!- Returns:
- the image file list.
-
isHeaderFile
Return true if the file specified by absolutePath is header file of PARREC.- Parameters:
absolutePath- the file name including path information.- Returns:
- true if the specified file is header file.
-
isImageFile
Return true if the file specified by absolutePath is image file of PARREC.- Parameters:
absolutePath- the file name including path information.- Returns:
- true if the specified file is image file.
-
createImage
DOCUMENT ME!- Returns:
- DOCUMENT ME!
- Throws:
IOException- DOCUMENT ME!OutOfMemoryError- DOCUMENT ME!
-
updateTransformMatrix
-
ConvertToMIPAVConvention
Converts translation matrix to mipav specific format -
makeTranslationMatrix
Makes rotation matrix based on image off-centres that were stored in header and converted to orientation-specific values. -
makeRotationMatrix
Makes rotation matrix based on image angulations that were stored in header and converted to orientation-specific values. -
getFileInfo
Returns the FileInfoAnalyze read from the file.- Returns:
- File info read from file, or null if it has not been read.
-
getHeaderFile
invalid input: '<'invalid input: '<'invalid input: '<'invalid input: '<'invalid input: '<'invalid input: '<'invalid input: '<' .working Returns the header file.- Returns:
- DOCUMENT ME!
-
getImageFiles
Returns the image file list.- Returns:
- the image file list.
-
readHeader
Reads the analyze header and stores the information in fileInfo.- Parameters:
imageFileName- File name of image.fileDir- Directory.- Returns:
- Flag to confirm a successful read.
- Throws:
IOException- if there is an error reading the header- See Also:
-
readImage
Reads an PAR/REC image file by reading the header then making a FileRaw to read the image for all filenames in the file list. Only the one file directory (currently) supported.- Parameters:
one- flag indicating one image of a 3D dataset should be read in.- Returns:
- The image.
- Throws:
IOException- if there is an error reading the fileOutOfMemoryError- See Also:
-
readImage
Reads in a PAR/REC image (first the header file, then the raw file)- Parameters:
buffer- Image buffer to store image data into.- Throws:
IOException- if there is an error reading the fileOutOfMemoryError- See Also:
-
writeImage
Writes a PAR/REC format image and header.- Parameters:
image- Image model of data to write.- Throws:
IOException- if there is an error writing the file- See Also:
-
getOffset
Helper method to calculate the offset for getting only the middle analyze image slice from the 3D file.- Parameters:
fileInfo- File info.- Returns:
- offset
-
updateStartLocations
Updates the start locations. Each image has a fileinfo where the start locations are stored. Note that the start location for the Z (3rd) dimension change with the change is the slice. The origin is in the upper left corner and we are using the right hand rule. + x -> left to right; + y -> top to bottom and + z -> into screen.- Parameters:
fileInfo- DOCUMENT ME!
-
updateUnitsOfMeasure
Updates the units of Measure in the file info based on the voxUnits from an Analyze Header.- Parameters:
fileInfo- -- an Analyze file Info that has already been readimage- -- a ModelImage that the fileInfo needs to be attached to
-
getCompleteFileNameListDefault
Gets the header and image file names given a header or image file name- Parameters:
absolutePath- header or image filename- Returns:
- array [0] headerfilename [1] imagefilename
-
writeHeader
public void writeHeader(ModelImage writeImage, String headerFileName, int beginSlice, int endSlice, int beginTime, int endTime, boolean rescale) throws IOException - Parameters:
writeImage-headerFileName-beginSlice-endSlice-beginTime-endTime-rescale-- Throws:
IOException
-
buildParVolMap
-
buildParSliceMap
-