Class FileAfni
In Afni 3 .HEAD files may be present with just 1 .BRIK file containing the original Data. The +orig.BRIK file will contain the data, the +orig.HEAD file will describe transformation to create the original image, the +acpc.HEAD file will describe the transformation needed to create the acpc image, and the +tlrc.HEAD file will describe the transformation needed to create the Talairach image.
Special notes:
The document README.attributes specifies DICOM order for MARKS_XYZ, but the sample file anat+orig.HEAD has dataset order. The sample file anat+ACPC.HEAD has DICOM order.
The original data must be resampled to cubic voxels for +acpc and +tlrc space. In FAQ 67, How can I compare
'small' and 'big' in Talairach box datasets, the text states:
If you have used the default 1 mm. voxel size in +tlrc coordinates(as almost everyone does)...
The function THD_3dmm_to_dicomm does changes the ordering of x, y, and z, but never inverts them. That is either R-L or L-R could be present in AFNI's Dicom ordering, either S-I or I-S could be present in AFNI's dicom ordering, and either A-P or P-A could be present in AFNI's dicom ordering. I perform inversions in my code so that I always have x = R-L, Y = A-P, and Z = I-S, the standard dicom ordering.
To obtain the afni rr, bvec, and svec values, I must not invert axes in dicom ordering, and I must not adjust the marker coordinates for resolution and origin.
The function of the SKIP fields is not defined in the AFNI documentation.
Note that AFNI code uses mfor for forward transformation and mbac for backward transformation. Our interpolation
routines perform a output to input mapping so since I am skipping the transform() section of AlgorithmTransform which
has the line xfrm = matrixtoInverseArray(transMatrix);
I wish to use mbac in FileAfni and ViewJFrameTriImage.
For +orig to +acpc mapping mbac is simply the transpose(also the inverse) of mfor.
For +acpc to +tlrc use 1 over the scale factors in mbac as opposed to the scale factors in mfor.
Note that in the sample files func+orig.head and anat+orig.head the origin location in millimeters is chosen so that 0,0,0 in millimeters is at the center of the image. In anat+acpc.head and anat+tlrc.head the origin location in millimeters ensures that the Talairach center is at 0,0,0.
AFNI:Software for Analysis and Visualization of Functional Magnetic Resonance Neuroimages by Robert W. Cox states: "In some applications, gaps are present between the functional slices. For example, some investigators using sagittal functional images do not collect data that spans the longitudinal fissure, but instead leave a 3-5 mm gap there. The auxiliary program abut can provide zero-filled images to fill in the gaps, and can resample the nonzero slices to a finer mesh if needed(e.g., to fill a 2 mm gap in a series of 4 mm functional slices). Resampling in the slice select direction between contiguous input slices can be done using nearest- neighbor, linear, or cubic interpolation, at the user's discretion. Interpolation is not done across the boundaries between the gap-filling zero images and the nonzero user-supplied images; that is, interpolation is only done inside spatially contiguous blocks of actual input data."
A second special consideration exists in the interpolation of functional data. The MCW AFNI - User Manual states: "In this version of AFNI, the threshold data (e.g., correlation coefficient) is always resampled using the nearest neighbor method. This is because thresholding with an interpolated nonlinear statistic is a somewhat dubious procedure." At another point the manual states: "Threshold data in functional datasets is always resampled using the nearest neighbor mode. This is becasue it is somewhat unreasonable to interpolate a nonlinear statistic (such as correlation coefficient) between voxels, and then to interpret this statistic using probabilistic models that assume independence."
v1:time+orig.HEAD has 1 = ORI_L2R_TYPE for the third ORIENT_SPECIFIC value, -53 for the third ORIGIN value, and 7 for the third delta value. However, delta should be negative for ORI_L2R_TYPE. I changed the values to those found in v2:time+orig.HEAD, namely 1 for the third ORIENT_SPECIFIC value, 52 for the third ORIGIN value, and -7 for the third delta value. The observed overlap was then excellent for v1_time+orig.HEAD and anat+orig.HEAD, anat+ACPC.HEAD, and anat+TLRC.HEAD.
- Author:
- William Gandler
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate WildMagic.LibFoundation.Mathematics.Vector3fAnterior Comissure in acpc space.private WildMagic.LibFoundation.Mathematics.Vector3fDOCUMENT ME!private WildMagic.LibFoundation.Mathematics.Vector3fDOCUMENT ME!private StringDOCUMENT ME!private WildMagic.LibFoundation.Mathematics.Vector3fDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private booleanDOCUMENT ME!private booleanDOCUMENT ME!static final intDOCUMENT ME!static final intDOCUMENT ME!static final intDOCUMENT ME!static final intDOCUMENT ME!static final intDOCUMENT ME!static final intDOCUMENT ME!static final intDOCUMENT ME!static final intDOCUMENT ME!static final intDOCUMENT ME!static final intDOCUMENT ME!static final intDOCUMENT ME!static final intfuncType for anatType == true.private StringDOCUMENT ME!private booleanDOCUMENT ME!private WildMagic.LibFoundation.Mathematics.Vector3fDOCUMENT ME!private static final floatDOCUMENT ME!private static final floatDOCUMENT ME!private static final floatDOCUMENT ME!private static final floatDOCUMENT ME!private static final floatDOCUMENT ME!private float[]DOCUMENT ME!private StringDOCUMENT ME!private String[]Sub-brick namesprivate float[]Each BLT is defined by a struct that contains two 3x3 matrices and four 3-vectors (2*3*3 + 4*3 = the 30 numbers).private float[]DOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private StringDOCUMENT ME!private intDOCUMENT ME!private int[]DOCUMENT ME!private int[]DOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!private intDOCUMENT ME!private float[]DOCUMENT ME!private float[]DOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private floatDicom ordered bounding box in mm.private floatDicom ordered bounding box in mm.private floatDicom ordered bounding box in mm.private int[]DOCUMENT ME!private float[]DOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private booleanDOCUMENT ME!private intFUNC_TT_TYPE Student t Degrees-of-Freedom (DOF).private booleanDOCUMENT ME!private FileDOCUMENT ME!private StringDOCUMENT ME!private FileInfoAfniDOCUMENT ME!private FileInfoAfniprivate longDOCUMENT ME!private StringDOCUMENT ME!private WildMagic.LibFoundation.Mathematics.Vector3fDOCUMENT ME!static final intDOCUMENT ME!private intDOCUMENT ME!static final floatDOCUMENT ME!static final intDOCUMENT ME!static final floatDOCUMENT ME!static final floatDOCUMENT ME!static final intDOCUMENT ME!static final intDOCUMENT ME!static final floatDOCUMENT ME!static final floatDOCUMENT ME!static final intDOCUMENT ME!static final floatDOCUMENT ME!static final intDOCUMENT ME!static final intfuncType for anatType == false.static final floatDOCUMENT ME!static final intDOCUMENT ME!static final floatDOCUMENT ME!static final floatDOCUMENT ME!static final intDOCUMENT ME!static final floatDOCUMENT ME!static final intDOCUMENT ME!static final float6 funcType of functional data have default scaling for byte data.static final floatUnfortunately, the func type codes overlap for Func and Anat datasets.static final intDOCUMENT ME!static final floatDOCUMENT ME!static final floatDOCUMENT ME!static final intDOCUMENT ME!static final floatDOCUMENT ME!static final floatDOCUMENT ME!static final intDOCUMENT ME!private intDOCUMENT ME!private booleanDOCUMENT ME!private booleanDOCUMENT ME!private floatDataset ordered bounding box in mm.private floatDataset ordered bounding box in mm.private floatDataset ordered bounding box in mm.private StringDOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!private ModelImageDOCUMENT ME!private float[]DOCUMENT ME!private float[]DOCUMENT ME!private int[]DOCUMENT ME!private float[]DOCUMENT ME!static final intattribute types.private booleanDOCUMENT ME!private booleanDOCUMENT ME!private booleanDOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!private booleanDOCUMENT ME!private floatDataset ordered bounding box in mm.private floatDataset ordered bounding box in mm.private floatDataset ordered bounding box in mm.static final intmarker types.static final intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private String[]DOCUMENT ME!private String[]DOCUMENT ME!private float[]DOCUMENT ME!private intFUNC_FT_TYPE F ratio Numerator DOF, Denominator DOF.private StringDOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intFUNC_BN_TYPE Binomial # Trials, Probability per trial.private int[]DOCUMENT ME!private WildMagic.LibFoundation.Mathematics.Vector3fDOCUMENT ME!private float[]DOCUMENT ME!private booleanDOCUMENT ME!private int[]DOCUMENT ME!private float[]DOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!private float[]DOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private WildMagic.LibFoundation.Mathematics.Vector3fDOCUMENT ME!private WildMagic.LibFoundation.Mathematics.Vector3fDOCUMENT ME!private WildMagic.LibFoundation.Mathematics.Vector3fDOCUMENT ME!private intDOCUMENT ME!private booleanDOCUMENT ME!private booleanDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private float[]DOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private float[]# orts are nuisance parameters whose number is >= 1.private intDOCUMENT ME!static final intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private WildMagic.LibFoundation.Mathematics.Vector3fDOCUMENT ME!private float[]The "p-values" for fico, fitt, and fizt datasets are 2-sided: that is, the value displayed by AFNI (below the slider) is the probability that the absolute value of such a deviate will exceed the threshold value on the slider.private intDOCUMENT ME!private float[]DOCUMENT ME!private String2560 characters giving the help strings for the markers (256 chars per marker, EXACTLY, including the NULS).private float[]DOCUMENT ME!private intDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private intDOCUMENT ME!private TalairachTransformInfoDOCUMENT ME!private float[]DOCUMENT ME!private StringDOCUMENT ME!private intDOCUMENT ME!private ViewUserInterfaceDOCUMENT ME!static final intDOCUMENT ME!static final inttime step units.static final intDOCUMENT ME!private intDOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!private float[]DOCUMENT ME!private float[]For sub-brick #xxxxxx (so a max of 999,999 sub-bricks can be used), this stores 12 numbers for the matrix-vector of transformation from 3dvolreg.private StringDOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!private float[]DOCUMENT ME!private float[]DOCUMENT ME!private float[]DOCUMENT ME!private float[]DOCUMENT ME!private float[]DOCUMENT ME!private float[]DOCUMENT ME!private float[]DOCUMENT ME!private float[]DOCUMENT ME!private float[]DOCUMENT ME!private float[]DOCUMENT ME!private intDOCUMENT ME!private StringDOCUMENT ME!private StringDOCUMENT ME!static final intwarp types.static final intDOCUMENT ME!private float[]DOCUMENT ME!private StringDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private intDOCUMENT ME!private int[]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 -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcalcOriginalMarker(int markerNumber) DOCUMENT ME!private voidDOCUMENT ME!private WildMagic.LibFoundation.Mathematics.Vector3fcrossProduct(WildMagic.LibFoundation.Mathematics.Vector3f pt1, WildMagic.LibFoundation.Mathematics.Vector3f pt2) Finds crossproduct of two vectors.private WildMagic.LibFoundation.Mathematics.Vector3fdicomMarker(WildMagic.LibFoundation.Mathematics.Vector3f pMarker) DOCUMENT ME!private floatdist(WildMagic.LibFoundation.Mathematics.Vector3f pt1, WildMagic.LibFoundation.Mathematics.Vector3f pt2, float[] resol) DOCUMENT ME!private floatdotProduct(WildMagic.LibFoundation.Mathematics.Vector3f pt1, WildMagic.LibFoundation.Mathematics.Vector3f pt2) DOCUMENT ME!voidfinalize()Prepares this class for cleanup.getFileInfo - accessor that returns the file info.float[]getImageBuffer - accessor that returns the image buffer.private WildMagic.LibFoundation.Mathematics.Vector3fmakemmVector3f(WildMagic.LibFoundation.Mathematics.Vector3f pt, float[] resol) DOCUMENT ME!private WildMagic.LibFoundation.Mathematics.Vector3fmakeVoxelCoord3Df(WildMagic.LibFoundation.Mathematics.Vector3f pt, float[] resol) DOCUMENT ME!private WildMagic.LibFoundation.Mathematics.Vector3fnorm(WildMagic.LibFoundation.Mathematics.Vector3f pt) Finds the normal to the vector.voidreadBuffer(int slice, float[] buffer, float scaleFact, int numRead) Reads a slice of data at a time and stores the results in the buffer.booleanReads AFNI header (.HEAD file)readImage.private ModelImageReads AFNI image (.BRIK file)private StringreadLine()readLine() - reads a line of the file and strips comments indicated by the # symbol.voidreadXYZBuffer(int slice, float[] buffer, float[] dicomBuffer, float scaleFact) Reads a slice of data at a time and stores the results in the buffer.private StringremoveWhiteSpace(String inString) DOCUMENT ME!private voidreposMarker(int markerNumber) DOCUMENT ME!private WildMagic.LibFoundation.Mathematics.Vector3fsclAdd(float fa, WildMagic.LibFoundation.Mathematics.Vector3f a, float fb, WildMagic.LibFoundation.Mathematics.Vector3f b) scale and add two vectors.voidsetFileName(String fName) setFileName - accessor to set the file name (used when reading TIFF multiFile).private WildMagic.LibFoundation.Mathematics.Vector3fsub(WildMagic.LibFoundation.Mathematics.Vector3f pt1, WildMagic.LibFoundation.Mathematics.Vector3f pt2) DOCUMENT ME!private voidtransformACPCTrilinear(float[] imgBuffer, TransMatrix xfrm, float iXres, float iYres, float iZres, int iXdim, int iYdim, int iZdim, float oXres, float oYres, float oZres, int oXdim, int oYdim, int oZdim) transformACPCTrilinear - transforms and resamples volume using trilinear interpolation.private voidtransformTalairachTrilinear(float[] imgBuffer, TransMatrix xfrm, float iXres, float iYres, float iZres, int iXdim, int iYdim, int iZdim, float oXres, float oYres, float oZres, int oXdim, int botX, int botY, int botZ, int topX, int topY, int topZ) transformTalairachTrilinear - transforms and resamples volume using trilinear interpolation.voidwriteImage(ModelImage image, FileWriteOptions options) Writes a AFNI format type image.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
-
INTEGER_ATTRIBUTE
public static final int INTEGER_ATTRIBUTEattribute types.- See Also:
-
FLOAT_ATTRIBUTE
public static final int FLOAT_ATTRIBUTEDOCUMENT ME!- See Also:
-
STRING_ATTRIBUTE
public static final int STRING_ATTRIBUTEDOCUMENT ME!- See Also:
-
ANAT_SPGR_TYPE
public static final int ANAT_SPGR_TYPEfuncType for anatType == true.- See Also:
-
ANAT_FSE_TYPE
public static final int ANAT_FSE_TYPEDOCUMENT ME!- See Also:
-
ANAT_EPI_TYPE
public static final int ANAT_EPI_TYPEDOCUMENT ME!- See Also:
-
ANAT_MRAN_TYPE
public static final int ANAT_MRAN_TYPEDOCUMENT ME!- See Also:
-
ANAT_CT_TYPE
public static final int ANAT_CT_TYPEDOCUMENT ME!- See Also:
-
ANAT_SPECT_TYPE
public static final int ANAT_SPECT_TYPEDOCUMENT ME!- See Also:
-
ANAT_PET_TYPE
public static final int ANAT_PET_TYPEDOCUMENT ME!- See Also:
-
ANAT_MRA_TYPE
public static final int ANAT_MRA_TYPEDOCUMENT ME!- See Also:
-
ANAT_BMAP_TYPE
public static final int ANAT_BMAP_TYPEDOCUMENT ME!- See Also:
-
ANAT_DIFF_TYPE
public static final int ANAT_DIFF_TYPEDOCUMENT ME!- See Also:
-
ANAT_OMRI_TYPE
public static final int ANAT_OMRI_TYPEDOCUMENT ME!- See Also:
-
ANAT_BUCK_TYPE
public static final int ANAT_BUCK_TYPEDOCUMENT ME!- See Also:
-
FUNC_FIM_TYPE
public static final int FUNC_FIM_TYPEfuncType for anatType == false.- See Also:
-
FUNC_THR_TYPE
public static final int FUNC_THR_TYPEDOCUMENT ME!- See Also:
-
FUNC_COR_TYPE
public static final int FUNC_COR_TYPEDOCUMENT ME!- See Also:
-
FUNC_TT_TYPE
public static final int FUNC_TT_TYPEDOCUMENT ME!- See Also:
-
FUNC_FT_TYPE
public static final int FUNC_FT_TYPEDOCUMENT ME!- See Also:
-
FUNC_ZT_TYPE
public static final int FUNC_ZT_TYPEDOCUMENT ME!- See Also:
-
FUNC_CT_TYPE
public static final int FUNC_CT_TYPEDOCUMENT ME!- See Also:
-
FUNC_BT_TYPE
public static final int FUNC_BT_TYPEDOCUMENT ME!- See Also:
-
FUNC_BN_TYPE
public static final int FUNC_BN_TYPEDOCUMENT ME!- See Also:
-
FUNC_GT_TYPE
public static final int FUNC_GT_TYPEDOCUMENT ME!- See Also:
-
FUNC_PT_TYPE
public static final int FUNC_PT_TYPEDOCUMENT ME!- See Also:
-
FUNC_BUCK_TYPE
public static final int FUNC_BUCK_TYPEDOCUMENT ME!- See Also:
-
FUNC_THR_SCALE_SHORT
public static final float FUNC_THR_SCALE_SHORTUnfortunately, the func type codes overlap for Func and Anat datasets. This means that one cannot tell the contents of a dataset from a single attribute. Default scale factors for functional data threshold values stored as shorts If BRICK_FLOAT_FACS is not supplied and the threshold functional data is stored as shorts, then AFNI will apply a default scale factor unless the data is FUNC_FIM_TYPE with only an intensity value and no threshold value or FUNC_BUCK_TYPE which has a default scale factor of 1.- See Also:
-
FUNC_COR_SCALE_SHORT
public static final float FUNC_COR_SCALE_SHORTDOCUMENT ME!- See Also:
-
FUNC_TT_SCALE_SHORT
public static final float FUNC_TT_SCALE_SHORTDOCUMENT ME!- See Also:
-
FUNC_FT_SCALE_SHORT
public static final float FUNC_FT_SCALE_SHORTDOCUMENT ME!- See Also:
-
FUNC_ZT_SCALE_SHORT
public static final float FUNC_ZT_SCALE_SHORTDOCUMENT ME!- See Also:
-
FUNC_CT_SCALE_SHORT
public static final float FUNC_CT_SCALE_SHORTDOCUMENT ME!- See Also:
-
FUNC_BT_SCALE_SHORT
public static final float FUNC_BT_SCALE_SHORTDOCUMENT ME!- See Also:
-
FUNC_BN_SCALE_SHORT
public static final float FUNC_BN_SCALE_SHORTDOCUMENT ME!- See Also:
-
FUNC_GT_SCALE_SHORT
public static final float FUNC_GT_SCALE_SHORTDOCUMENT ME!- See Also:
-
FUNC_PT_SCALE_SHORT
public static final float FUNC_PT_SCALE_SHORTDOCUMENT ME!- See Also:
-
FUNC_THR_SCALE_BYTE
public static final float FUNC_THR_SCALE_BYTE6 funcType of functional data have default scaling for byte data.- See Also:
-
FUNC_COR_SCALE_BYTE
public static final float FUNC_COR_SCALE_BYTEDOCUMENT ME!- See Also:
-
FUNC_TT_SCALE_BYTE
public static final float FUNC_TT_SCALE_BYTEDOCUMENT ME!- See Also:
-
FUNC_ZT_SCALE_BYTE
public static final float FUNC_ZT_SCALE_BYTEDOCUMENT ME!- See Also:
-
FUNC_BT_SCALE_BYTE
public static final float FUNC_BT_SCALE_BYTEDOCUMENT ME!- See Also:
-
FUNC_GT_SCALE_BYTE
public static final float FUNC_GT_SCALE_BYTEDOCUMENT ME!- See Also:
-
MARKSET_ALIGN
public static final int MARKSET_ALIGNmarker types.- See Also:
-
MARKSET_BOUNDING
public static final int MARKSET_BOUNDINGDOCUMENT ME!- See Also:
-
WARP_AFFINE_TYPE
public static final int WARP_AFFINE_TYPEwarp types.- See Also:
-
WARP_TALAIRACH_12_TYPE
public static final int WARP_TALAIRACH_12_TYPEDOCUMENT ME!- See Also:
-
UNITS_MSEC_TYPE
public static final int UNITS_MSEC_TYPEtime step units.- See Also:
-
UNITS_SEC_TYPE
public static final int UNITS_SEC_TYPEDOCUMENT ME!- See Also:
-
UNITS_HZ_TYPE
public static final int UNITS_HZ_TYPEDOCUMENT ME!- See Also:
-
ATLAS_FRONT_TO_AC
private static final float ATLAS_FRONT_TO_ACDOCUMENT ME!- See Also:
-
ATLAS_PC_TO_BACK
private static final float ATLAS_PC_TO_BACKDOCUMENT ME!- See Also:
-
ATLAS_BOT_TO_AC
private static final float ATLAS_BOT_TO_ACDOCUMENT ME!- See Also:
-
ATLAS_AC_TO_TOP
private static final float ATLAS_AC_TO_TOPDOCUMENT ME!- See Also:
-
ATLAS_AC_TO_LAT
private static final float ATLAS_AC_TO_LATDOCUMENT ME!- See Also:
-
acpcAC
private WildMagic.LibFoundation.Mathematics.Vector3f acpcACAnterior Comissure in acpc space. -
acpcMaxPt
private WildMagic.LibFoundation.Mathematics.Vector3f acpcMaxPtDOCUMENT ME! -
acpcMinPt
private WildMagic.LibFoundation.Mathematics.Vector3f acpcMinPtDOCUMENT ME! -
acpcName
DOCUMENT ME! -
acpcPC
private WildMagic.LibFoundation.Mathematics.Vector3f acpcPCDOCUMENT ME! -
acpcRes
private float acpcResDOCUMENT ME! -
acquisitionDuration
private float acquisitionDurationDOCUMENT ME! -
alsoAcpc
private boolean alsoAcpcDOCUMENT ME! -
alsoOrig
private boolean alsoOrigDOCUMENT ME! -
anatomyParentnameString
DOCUMENT ME! -
anatType
private boolean anatTypeDOCUMENT ME! -
anotherPtDicom
private WildMagic.LibFoundation.Mathematics.Vector3f anotherPtDicomDOCUMENT ME! -
brickFloatFacs
private float[] brickFloatFacsDOCUMENT ME! -
brickKeywordsString
DOCUMENT ME! -
brickLabsString
Sub-brick names -
brickStatAux
private float[] brickStatAuxEach BLT is defined by a struct that contains two 3x3 matrices and four 3-vectors (2*3*3 + 4*3 = the 30 numbers). These values are: [mfor] = 3x3 forward transformation matrix [0..8] 0,1,2 correspond to alpha.X, alpha.Y, alpha.Z 3,4,5 correspond to beta.X, beta.Y, beta.Z 6,7,8 correspond to gamma.X, gamma.Y, gamma.Z [mbac] = 3x3 backward transformation matrix [0..17] [bvec] = 3-vector for forward transformation [18..20] [svec] = 3-vector for backward transformation [21..23] [bot] [24..26] [top] [27..29] The matrices are stored in row major order; e.g., [ 0 1 2] [mfor] = [ 3 4 5] [ 6 7 8] the indices of the [mfor] matrix The forward transformation is [x_map] = [mfor][x_in] - [bvec] The backward transformation is [x_in] = [mbac][x_map] - [svec] which implies [svec] = -[mbac][bvec] and [mbac] = Inverse{[mfor]} The forward transformation is the transformation of Dicom order coordinates from the warp parent dataset (usually in the +orig view) to the warped dataset (usually +acpc or +tlrc). The backward transformation is just the inverse of the forward transformation, and is stored for convenience. It could be recomputed from the forward transformation whenever it was needed. The identity BLT would be stored as these 30 numbers: 1 0 0 0 1 0 [mfor] = I 0 0 1 1 0 0 0 1 0 [mbac] = I 0 0 1 0 0 0 [bvec] = 0 0 0 0 [svec] = 0 botx boty botz topx topy topz bot and top numbers depend on the application. If the transformation is WARP_TALAIRACH_TYPE, then each BLT type only applies to a bounded region of 3-space. The [bot] and [top] vectors define the limits for each BLT, in the warped [x_map] coordinates. These values are used in the function AFNI_transform_vector() to compute the transformation of a 3-vector between +orig and +tlrc coordinates. For example, to compute the transformation from +tlrc back to +orig of a vector [x_tlrc], the code must scan all 12 [bot]..[top] regions to see which BLT to use. Similarly, to transform [x_orig] from +orig to +tlrc, the vector must be transformed with each BLT and the result tested to see if it lies within the BLT's [bot]..[top] region. (if a lower bound is supposed to be -infinity, then that element of [bot] is -9999; if an upper bound is supposed to be +infinity then that element of [top] is +9999. For the +orig to +acpc transformation (of WARP_AFFINE_TYPE), the [bot] and [top] vectors store the bounding box of the transformed dataset. However, this fact isn't used much. -
brickStats
private float[] brickStatsDOCUMENT ME! -
brickType
private int brickTypeDOCUMENT ME! -
brickTypeNumber
private int brickTypeNumberDOCUMENT ME! -
brikDataType
private int brikDataTypeDOCUMENT ME! -
brikFileName
DOCUMENT ME! -
bufferSize
private int bufferSizeDOCUMENT ME! -
dataExtents
private int[] dataExtentsDOCUMENT ME! -
dataOrient
private int[] dataOrientDOCUMENT ME! -
datasetKeywordsString
DOCUMENT ME! -
datasetNameString
DOCUMENT ME! -
ddof
private int ddofDOCUMENT ME! -
delta
private float[] deltaDOCUMENT ME! -
dicomDelta
private float[] dicomDeltaDOCUMENT ME! -
dicomHighestX
private float dicomHighestXDOCUMENT ME! -
dicomHighestY
private float dicomHighestYDOCUMENT ME! -
dicomHighestZ
private float dicomHighestZDOCUMENT ME! -
dicomLowestX
private float dicomLowestXDicom ordered bounding box in mm. -
dicomLowestY
private float dicomLowestYDicom ordered bounding box in mm. -
dicomLowestZ
private float dicomLowestZDicom ordered bounding box in mm. -
dicomOrientation
private int[] dicomOrientationDOCUMENT ME! -
dicomOrigin
private float[] dicomOriginDOCUMENT ME! -
dicomSliceSize
private int dicomSliceSizeDOCUMENT ME! -
dicomXDim
private int dicomXDimDOCUMENT ME! -
dicomYDim
private int dicomYDimDOCUMENT ME! -
dicomZDim
private int dicomZDimDOCUMENT ME! -
dist_ant
private float dist_antDOCUMENT ME! -
dist_med
private float dist_medDOCUMENT ME! -
dist_pos
private float dist_posDOCUMENT ME! -
dist_sup
private float dist_supDOCUMENT ME! -
dist_inf
private float dist_infDOCUMENT ME! -
dist_lef
private float dist_lefDOCUMENT ME! -
dist_rig
private float dist_rigDOCUMENT ME! -
doDicom
private boolean doDicomDOCUMENT ME! -
dof
private int dofFUNC_TT_TYPE Student t Degrees-of-Freedom (DOF). -
endianess
private boolean endianessDOCUMENT ME! -
file
DOCUMENT ME! -
fileDir
DOCUMENT ME! -
fileInfo
DOCUMENT ME! -
fileInfoCopy
-
fileLength
private long fileLengthDOCUMENT ME! -
fileName
DOCUMENT ME! -
firstPtDicom
private WildMagic.LibFoundation.Mathematics.Vector3f firstPtDicomDOCUMENT ME! -
floatsPerTag
private int floatsPerTagDOCUMENT ME! -
funcType
private int funcTypeDOCUMENT ME! -
haveReadACPC
private boolean haveReadACPCDOCUMENT ME! -
haveReadOrig
private boolean haveReadOrigDOCUMENT ME! -
historyNoteString
DOCUMENT ME! -
idcodeAnatParentString
DOCUMENT ME! -
idcodeDateString
DOCUMENT ME! -
idcodeString
DOCUMENT ME! -
idcodeWarpParentString
DOCUMENT ME! -
image
DOCUMENT ME! -
img2Buffer
private float[] img2BufferDOCUMENT ME! -
imgBuffer
private float[] imgBufferDOCUMENT ME! -
imgExtents
private int[] imgExtentsDOCUMENT ME! -
imgResols
private float[] imgResolsDOCUMENT ME! -
invertX
private boolean invertXDOCUMENT ME! -
invertY
private boolean invertYDOCUMENT ME! -
invertZ
private boolean invertZDOCUMENT ME! -
label1String
DOCUMENT ME! -
label2String
DOCUMENT ME! -
loadB
private boolean loadBDOCUMENT ME! -
lowestX
private float lowestXDataset ordered bounding box in mm. -
lowestY
private float lowestYDataset ordered bounding box in mm. -
lowestZ
private float lowestZDataset ordered bounding box in mm. -
highestX
private float highestXDataset ordered bounding box in mm. -
highestY
private float highestYDataset ordered bounding box in mm. -
highestZ
private float highestZDataset ordered bounding box in mm. -
marksFlag
private int marksFlagDOCUMENT ME! -
marksFlags
private int marksFlagsDOCUMENT ME! -
marksHelpString
DOCUMENT ME! -
marksLabString
DOCUMENT ME! -
marksXYZ
private float[] marksXYZDOCUMENT ME! -
ndof
private int ndofFUNC_FT_TYPE F ratio Numerator DOF, Denominator DOF. -
noteDate001String
DOCUMENT ME! -
noteDate002String
DOCUMENT ME! -
noteDate003String
DOCUMENT ME! -
noteDate004String
DOCUMENT ME! -
noteDate005String
DOCUMENT ME! -
noteNumber001String
DOCUMENT ME! -
noteNumber002String
DOCUMENT ME! -
noteNumber003String
DOCUMENT ME! -
noteNumber004String
DOCUMENT ME! -
noteNumber005String
DOCUMENT ME! -
notesCount
private int notesCountDOCUMENT ME! -
numberDicomSlices
private int numberDicomSlicesDOCUMENT ME! -
numberSlices
private int numberSlicesDOCUMENT ME! -
numFitParam
private int numFitParamDOCUMENT ME! -
numNuisanceParam
private int numNuisanceParamDOCUMENT ME! -
numSamples
private int numSamplesDOCUMENT ME! -
numTrials
private int numTrialsFUNC_BN_TYPE Binomial # Trials, Probability per trial. -
orientSpecific
private int[] orientSpecificDOCUMENT ME! -
origAC
private WildMagic.LibFoundation.Mathematics.Vector3f origACDOCUMENT ME! -
origDelta
private float[] origDeltaDOCUMENT ME! -
origDicom
private boolean origDicomDOCUMENT ME! -
origExtents
private int[] origExtentsDOCUMENT ME! -
origin
private float[] originDOCUMENT ME! -
originalFileName
DOCUMENT ME! -
origName
DOCUMENT ME! -
origOrigin
private float[] origOriginDOCUMENT ME! -
origXDim
private int origXDimDOCUMENT ME! -
origYDim
private int origYDimDOCUMENT ME! -
origZDim
private int origZDimDOCUMENT ME! -
pcDicom
private WildMagic.LibFoundation.Mathematics.Vector3f pcDicomDOCUMENT ME! -
pointMarker
private WildMagic.LibFoundation.Mathematics.Vector3f pointMarkerDOCUMENT ME! -
posteriorMarginDicom
private WildMagic.LibFoundation.Mathematics.Vector3f posteriorMarginDicomDOCUMENT ME! -
presentViewType
private int presentViewTypeDOCUMENT ME! -
readACPC
private boolean readACPCDOCUMENT ME! -
readTLRC
private boolean readTLRCDOCUMENT ME! -
scale_A
private float scale_ADOCUMENT ME! -
scale_M
private float scale_MDOCUMENT ME! -
scale_P
private float scale_PDOCUMENT ME! -
scale_S
private float scale_SDOCUMENT ME! -
scale_I
private float scale_IDOCUMENT ME! -
scale_L
private float scale_LDOCUMENT ME! -
scale_R
private float scale_RDOCUMENT ME! -
skip
private float[] skipDOCUMENT ME! -
sliceSize
private int sliceSizeDOCUMENT ME! -
slicesWithTimeOffsets
private int slicesWithTimeOffsetsDOCUMENT ME! -
statAux
private float[] statAux# orts are nuisance parameters whose number is >= 1. -
statCode
private int statCodeDOCUMENT ME! -
subBrickIndex
private int subBrickIndexDOCUMENT ME! -
subBrickNumber
private int subBrickNumberDOCUMENT ME! -
superiorEdgeDicom
private WildMagic.LibFoundation.Mathematics.Vector3f superiorEdgeDicomDOCUMENT ME! -
tagAlignMatvec
private float[] tagAlignMatvecThe "p-values" for fico, fitt, and fizt datasets are 2-sided: that is, the value displayed by AFNI (below the slider) is the probability that the absolute value of such a deviate will exceed the threshold value on the slider. The "p-values" for the other types are 1-sided: that is, the value displayed by AFNI is the probability that the value of the deviate will exceed the threshold value. (Of course, these probabilities are computed under the appropriate null hypothesis, and assuming that the distributional model holds exactly. The latter assumption, in particular, is fairly dubious.) Registration attributes Note that the MATVEC attributes are transformations of Dicom-ordered coordinates, and so have to be permuted to transform dataset-ordered xyz-coordinates. The MATVEC attributes describe the transformation of coordinates from the input dataset to the output dataset in the form [xyz_out] = [mat] ([xyz_in] - [xyz_cen]) + [vec] + [xyz_cen] where [mat] is a 3x3 orthogonal matrix [vec] is a 3-vector [xyz_in] is the input vector [xyz_cen] is the center of rotation (usually the center of the dataset) [xyz_out] is the output vector Dicom coordinate order is used for these matrices and vectors, which means that they need to be permuted to dataset order for application -
tagNumber
private int tagNumberDOCUMENT ME! -
tagsetFloats
private float[] tagsetFloatsDOCUMENT ME! -
tagsetLabelsString
2560 characters giving the help strings for the markers (256 chars per marker, EXACTLY, including the NULS). -
tAxisOffsets
private float[] tAxisOffsetsDOCUMENT ME! -
tDim
private int tDimDOCUMENT ME! -
timeOrigin
private float timeOriginDOCUMENT ME! -
timeStep
private float timeStepDOCUMENT ME! -
timeStepUnit
private int timeStepUnitDOCUMENT ME! -
tInfo
DOCUMENT ME! -
tlrcRes
private float[] tlrcResDOCUMENT ME! -
typeString
DOCUMENT ME! -
typeStringType
private int typeStringTypeDOCUMENT ME! -
UI
DOCUMENT ME! -
viewType
private int viewTypeDOCUMENT ME! -
volregBaseIdcodeString
DOCUMENT ME! -
volregBaseNameString
DOCUMENT ME! -
volregCenterBase
private float[] volregCenterBaseDOCUMENT ME! -
volregCenterOld
private float[] volregCenterOldFor sub-brick #xxxxxx (so a max of 999,999 sub-bricks can be used), this stores 12 numbers for the matrix-vector of transformation from 3dvolreg. -
volregGridparentIdcodeString
DOCUMENT ME! -
volregGridparentNameString
DOCUMENT ME! -
volregInputIdcodeString
DOCUMENT ME! -
volregInputNameString
DOCUMENT ME! -
volregMatvec000000
private float[] volregMatvec000000DOCUMENT ME! -
volregMatvec000001
private float[] volregMatvec000001DOCUMENT ME! -
volregMatvec000002
private float[] volregMatvec000002DOCUMENT ME! -
volregMatvec000003
private float[] volregMatvec000003DOCUMENT ME! -
volregMatvec000004
private float[] volregMatvec000004DOCUMENT ME! -
volregMatvec000005
private float[] volregMatvec000005DOCUMENT ME! -
volregMatvec000006
private float[] volregMatvec000006DOCUMENT ME! -
volregMatvec000007
private float[] volregMatvec000007DOCUMENT ME! -
volregMatvec000008
private float[] volregMatvec000008DOCUMENT ME! -
volregMatvec000009
private float[] volregMatvec000009DOCUMENT ME! -
volregRotcomNum
private int volregRotcomNumDOCUMENT ME! -
volregRotparentIdcodeString
DOCUMENT ME! -
volregRotparentNameString
DOCUMENT ME! -
warpData
private float[] warpDataDOCUMENT ME! -
warpParentnameString
DOCUMENT ME! -
warpType
private int warpTypeDOCUMENT ME! -
xDim
private int xDimDOCUMENT ME! -
yDim
private int yDimDOCUMENT ME! -
zAxisOffset
private float zAxisOffsetDOCUMENT ME! -
zAxisStep
private float zAxisStepDOCUMENT ME! -
zDim
private int zDimDOCUMENT ME! -
zeroPad
private int[] zeroPadDOCUMENT ME!
-
-
Constructor Details
-
FileAfni
Afni reader constructor.- Parameters:
fileName- file namefileDir- file directoryloadB- flag indicating if this is a B imagedoRead- whether class is created for reading afni file, or for writing- Throws:
IOException- if there is an error making the file
-
-
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. -
getFileInfo
getFileInfo - accessor that returns the file info.- Returns:
- FileInfoBase containing the file info
-
getImageBuffer
public float[] getImageBuffer()getImageBuffer - accessor that returns the image buffer.- Returns:
- buffer of image.
-
readImage
readImage.- Returns:
- returns the image
- Throws:
IOException- if there is an error reading the file
-
setFileName
setFileName - accessor to set the file name (used when reading TIFF multiFile).- Parameters:
fName- file name of image to read.
-
getModelLUT
-
writeImage
Writes a AFNI format type image.- Parameters:
image- Image model of data to write.options- options such as starting and ending slices and times- Throws:
IOException- if there is an error writing the file
-
calcOriginalMarker
private void calcOriginalMarker(int markerNumber) DOCUMENT ME!- Parameters:
markerNumber- DOCUMENT ME!
-
createOrderDialog
private void createOrderDialog()DOCUMENT ME! -
crossProduct
private WildMagic.LibFoundation.Mathematics.Vector3f crossProduct(WildMagic.LibFoundation.Mathematics.Vector3f pt1, WildMagic.LibFoundation.Mathematics.Vector3f pt2) Finds crossproduct of two vectors.- Parameters:
pt1- First vector.pt2- Second vector- Returns:
- Cross product of pt1 and pt2.
-
dicomMarker
private WildMagic.LibFoundation.Mathematics.Vector3f dicomMarker(WildMagic.LibFoundation.Mathematics.Vector3f pMarker) DOCUMENT ME!- Parameters:
pMarker- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
dist
private float dist(WildMagic.LibFoundation.Mathematics.Vector3f pt1, WildMagic.LibFoundation.Mathematics.Vector3f pt2, float[] resol) DOCUMENT ME!- Parameters:
pt1- DOCUMENT ME!pt2- DOCUMENT ME!resol- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
dotProduct
private float dotProduct(WildMagic.LibFoundation.Mathematics.Vector3f pt1, WildMagic.LibFoundation.Mathematics.Vector3f pt2) DOCUMENT ME!- Parameters:
pt1- DOCUMENT ME!pt2- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
makemmVector3f
private WildMagic.LibFoundation.Mathematics.Vector3f makemmVector3f(WildMagic.LibFoundation.Mathematics.Vector3f pt, float[] resol) DOCUMENT ME!- Parameters:
pt- DOCUMENT ME!resol- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
makeVoxelCoord3Df
private WildMagic.LibFoundation.Mathematics.Vector3f makeVoxelCoord3Df(WildMagic.LibFoundation.Mathematics.Vector3f pt, float[] resol) DOCUMENT ME!- Parameters:
pt- DOCUMENT ME!resol- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
norm
private WildMagic.LibFoundation.Mathematics.Vector3f norm(WildMagic.LibFoundation.Mathematics.Vector3f pt) Finds the normal to the vector.- Parameters:
pt- Vector to find normal to.- Returns:
- Normal of pt.
-
readBuffer
Reads a slice of data at a time and stores the results in the buffer.- Parameters:
slice- offset into the file stored in the dataOffset arraybuffer- buffer where the info is storedscaleFact- if zero data unscaled, if > 0 data is scaled by scaleFactnumRead- DOCUMENT ME!- Throws:
IOException- if there is an error reading the file
-
readHeader
Reads AFNI header (.HEAD file)- Throws:
IOException- if there is an error reading the file
-
readImage2
Reads AFNI image (.BRIK file)- Returns:
- Generated modelImage
- Throws:
IOException- data reading problem occured
-
readLine
readLine() - reads a line of the file and strips comments indicated by the # symbol.- Returns:
- the line read in
- Throws:
IOException- if there is an error reading the file
-
readXYZBuffer
public void readXYZBuffer(int slice, float[] buffer, float[] dicomBuffer, float scaleFact) throws IOException Reads a slice of data at a time and stores the results in the buffer.- Parameters:
slice- offset into the file stored in the dataOffset arraybuffer- buffer where the info is read intodicomBuffer- buffer into which the data is reorderedscaleFact- if zero data unscaled, if > 0 data is scaled by scaleFact- Throws:
IOException- if there is an error reading the file
-
removeWhiteSpace
DOCUMENT ME!- Parameters:
inString- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
reposMarker
private void reposMarker(int markerNumber) DOCUMENT ME!- Parameters:
markerNumber- DOCUMENT ME!
-
sclAdd
private WildMagic.LibFoundation.Mathematics.Vector3f sclAdd(float fa, WildMagic.LibFoundation.Mathematics.Vector3f a, float fb, WildMagic.LibFoundation.Mathematics.Vector3f b) scale and add two vectors.- Parameters:
fa- DOCUMENT ME!a- DOCUMENT ME!fb- DOCUMENT ME!b- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
sub
private WildMagic.LibFoundation.Mathematics.Vector3f sub(WildMagic.LibFoundation.Mathematics.Vector3f pt1, WildMagic.LibFoundation.Mathematics.Vector3f pt2) DOCUMENT ME!- Parameters:
pt1- DOCUMENT ME!pt2- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
transformACPCTrilinear
private void transformACPCTrilinear(float[] imgBuffer, TransMatrix xfrm, float iXres, float iYres, float iZres, int iXdim, int iYdim, int iZdim, float oXres, float oYres, float oZres, int oXdim, int oYdim, int oZdim) transformACPCTrilinear - transforms and resamples volume using trilinear interpolation.- Parameters:
imgBuffer- image arrayxfrm- transformation matrix to be appliediXres- DOCUMENT ME!iYres- DOCUMENT ME!iZres- DOCUMENT ME!iXdim- DOCUMENT ME!iYdim- DOCUMENT ME!iZdim- DOCUMENT ME!oXres- DOCUMENT ME!oYres- DOCUMENT ME!oZres- DOCUMENT ME!oXdim- DOCUMENT ME!oYdim- DOCUMENT ME!oZdim- DOCUMENT ME!
-
transformTalairachTrilinear
private void transformTalairachTrilinear(float[] imgBuffer, TransMatrix xfrm, float iXres, float iYres, float iZres, int iXdim, int iYdim, int iZdim, float oXres, float oYres, float oZres, int oXdim, int botX, int botY, int botZ, int topX, int topY, int topZ) transformTalairachTrilinear - transforms and resamples volume using trilinear interpolation.- Parameters:
imgBuffer- image arrayxfrm- transformation matrix to be appliediXres- DOCUMENT ME!iYres- DOCUMENT ME!iZres- DOCUMENT ME!iXdim- DOCUMENT ME!iYdim- DOCUMENT ME!iZdim- DOCUMENT ME!oXres- DOCUMENT ME!oYres- DOCUMENT ME!oZres- DOCUMENT ME!oXdim- DOCUMENT ME!botX- DOCUMENT ME!botY- DOCUMENT ME!botZ- DOCUMENT ME!topX- DOCUMENT ME!topY- DOCUMENT ME!topZ- DOCUMENT ME!
-