Class AlgorithmDTICreateListFile
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.DiffusionTensorImaging.AlgorithmDTICreateListFile
-
- All Implemented Interfaces:
AlgorithmInterface,java.awt.event.ActionListener,java.awt.event.WindowListener,java.lang.Runnable,java.util.EventListener
public class AlgorithmDTICreateListFile extends AlgorithmBase implements AlgorithmInterface
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classAlgorithmDTICreateListFile.InstanceNumberComparatorThis inner class is used to sort the list by instance numberprivate classAlgorithmDTICreateListFile.InstanceNumberVolComparatorThis inner class is used to sort the list by instance number and vol. the vol is determined by the filename
-
Field Summary
Fields Modifier and Type Field Description private intavgVolIndexPhilips puts in one volume as the average of all the DWIs.private java.lang.StringbmatrixFileNameB Matrix file nameprivate java.lang.StringbmtxtFilePathThis is the full path to the b matrix fileprivate java.util.ArrayList<java.lang.Float>bValuesArrayListthis is an array of b-values that for each volumeprivate floatcoarseRateregistration option parametersprivate floatcoarseRateXregistration option parametersprivate floatcoarseRateYregistration option parametersprivate floatcoarseRateZregistration option parametersprivate intcostregistration option parametersprivate java.lang.StringdicomB0VolumePathpath to dicom B0 for registration purposesprivate java.lang.String[]dicomInfoArray that holds the dicom tag info*private float[][]directionthis is the gradient matrix that is populated when reading the gradient fileprivate intDOFregistration option parametersprivate booleandoGraphregistration option parametersprivate booleandoMultiThreadregistration option parametersprivate booleandoSubsampleregistration option parametersprivate javax.swing.JTextFielddwiPathTextFieldhandle to dwi data textfield of main dialogprivate booleanfastModeregistration option parametersprivate FileInfoPARRECfileInfoPRfile info Par/Recprivate FileIOfileIOfile IOprivate FilePARRECfileParRecFileParRec handleprivate floatfineRateregistration option parametersprivate floatfineRateXregistration option parametersprivate floatfineRateYregistration option parametersprivate floatfineRateZregistration option parametersprivate FileInfoDicomfirstFileInfoDicomfirst fileinfo dicom...used for list file infoprivate intgeSoftwareVersionint telling software version if datset is GEprivate java.lang.StringgradientFilePathThis is the full path to the gradient fileprivate java.lang.StringhorizontalFOVStringhorizontal FOVprivate ModelImageimage4DModelImage of 4D par/rec datasetprivate ViewImageFileFilterimageFilterThis is the image filter needed to select the correct dicom imagesprivate java.lang.StringimageOrientationStringimage orientationprivate java.lang.StringimageSlicesDirPathpath for imageSlicesDirprivate intinterpregistration option parametersprivate intinterp2registration option parametersprivate booleanisDICOMboolean indicating if we are dealing with dicom or par/recprivate booleanisEDTIboolean telling if dataset is eDTIprivate booleanisGEboolean telling if datset is GEprivate booleanisInterleavedboolean if dataset is interelavedprivate booleanisOldVersionboolean identifying if par/rec datset is older than version 4.1private booleanisProcDirCreatedboolean if proc dir was createdprivate booleanisSiemensboolean telling if datset is SIEMENSprivate java.lang.StringlistFileNameList file nameprivate ModelImagematchImagemodel imagesprivate intmaxIterationsregistration option parametersprivate booleanmaxOfMinResolregistration option parametersprivate intnimthis is the number of gradient quantities that is obtained by reading first line of gradient fileprivate intnimCounterthis counter is used for version 4 of Par/Rec...nim is calculated from gradient fileprivate java.lang.StringnimStringt dimprivate intnumMinimaregistration option parametersprivate intnumSlicesPerVolumethis is the number of image slices per volumeprivate java.lang.StringnumSlicesStringz dimprivate java.util.ArrayList<java.lang.String[]>oldVersionGradientsALarraylist of gradients for version 4 of Par/Recprivate java.lang.StringoriginalColumnsStringx dimprivate java.lang.StringoriginalRowsStringy dimprivate javax.swing.JTextAreaoutputTextAreaTextArea of main dialog for text outputprivate java.lang.StringpathFileNamePath File nameprivate booleanperformRegistrationboolean for performing registrationprivate java.lang.StringphaseEncodingStringphase encoding...hard coded to verticalprivate java.lang.StringprFileDirpar rec file dirprivate java.lang.StringprFileNamepar rec file nameprivate java.lang.StringrawImageFormatStringraw image format...hardcoded to float since we will be outputting par/rec slices in float formatprivate ModelImagerefImagemodel imagesprivate AlgorithmRegOAR3Dreg3handle to AlgorithmRegOAR3Dprivate AlgorithmRegOAR35Dreg35handle to AlgorithmRegOAR35Dprivate java.lang.StringregisteredDicomB0VolumePathParentFolderregistered B0 parent folderprivate java.lang.StringregisteredStudyNamestudy name for registered data setprivate intregisterToregistration option parametersprivate java.lang.StringrelativeImageSlicesDirPathrelative path for slices dir for outputting to path fileprivate ModelImageresultImagemodel imagesprivate floatrotateBeginregistration option parametersprivate floatrotateBeginXregistration option parametersprivate floatrotateBeginYregistration option parametersprivate floatrotateBeginZregistration option parametersprivate floatrotateEndregistration option parametersprivate floatrotateEndXregistration option parametersprivate floatrotateEndYregistration option parametersprivate floatrotateEndZregistration option parametersprivate java.util.TreeMap<java.lang.Integer,java.util.TreeSet<java.lang.String[]>>seriesFileInfoTreeMapThis is an ordered map of series number and seriesFileInfoTreeSetprivate java.util.TreeSet<java.lang.String[]>seriesFileInfoTreeSetThis is an ordered list of files per series numberprivate java.lang.StringsliceGapStringslice gap Stringprivate java.lang.StringsliceThicknessStringsliec thicknessprivate java.lang.StringstudyNameThis is the dir name of the studyprivate java.lang.StringstudyPathThis is the full path of the studyprivate booleansuccessflag indicating if method was successfulprivate inttDimtDim of 4d imageprivate inttotalImageSlicestotal image slicesprivate inttotalNumVolumestotal num of volumes in studyprivate AlgorithmTransformtransformhandle to AlgorithmTransformprivate java.util.ArrayList<java.lang.String>unsortedPathsArrayListarraylist of unsorted path strings to image slicesprivate java.lang.StringverticalFOVStringvertical FOVprivate java.util.HashMap<java.lang.String,java.lang.String>volParametersvol parametersprivate intxDimxDIm of 4d imageprivate intxdimAparameter for AlgorithmTransformprivate floatxresAparameter for AlgorithmTransformprivate intyDimyDim of 4d imageprivate intydimAparameter for AlgorithmTransformprivate floatyresAparameter for AlgorithmTransformprivate intzDimzDim of 4d imageprivate intzdimAparameter for AlgorithmTransformprivate floatzresAparameter for AlgorithmTransform-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description AlgorithmDTICreateListFile(java.lang.String studyPath, java.lang.String studyName, java.lang.String dicomB0VolumePath, java.lang.String gradientFilePath, java.lang.String bmtxtFilePath, javax.swing.JTextArea outputTextArea, boolean isInterleaved, boolean performRegsitration, int cost, int DOF, int interp, int interp2, float rotateBeginX, float rotateEndX, float coarseRateX, float fineRateX, float rotateBeginY, float rotateEndY, float coarseRateY, float fineRateY, float rotateBeginZ, float rotateEndZ, float coarseRateZ, float fineRateZ, boolean maxOfMinResol, boolean doSubsample, boolean doMultiThread, boolean fastMode, int bracketBound, int maxIterations, int numMinima, javax.swing.JTextField dwiPathTextField)constructor for dicom if registration is to be done firstAlgorithmDTICreateListFile(java.lang.String fileName, java.lang.String fileDir, java.lang.String gradientFilePath, java.lang.String bmtxtFilePath, javax.swing.JTextArea outputTextArea, boolean performRegsitration)constructor for par/recAlgorithmDTICreateListFile(java.lang.String studyPath, java.lang.String studyName, java.lang.String gradientFilePath, java.lang.String bmtxtFilePath, javax.swing.JTextArea outputTextArea, boolean isInterleaved, boolean performRegsitration)constructor for dicomAlgorithmDTICreateListFile(java.lang.String fileName, java.lang.String fileDir, java.lang.String gradientFilePath, java.lang.String bmtxtFilePath, javax.swing.JTextArea outputTextArea, boolean performRegsitration, int cost, int DOF, int interp, int interp2, int registerTo, float rotateBegin, float rotateEnd, float coarseRate, float fineRate, boolean doSubsample, boolean doMultiThread, boolean fastMode, int bracketBound, int maxIterations, int numMinima, javax.swing.JTextField dwiPathTextField)constructor for par/rec if registration is to be done first
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidalgorithmPerformed(AlgorithmBase algorithm)Called after an algorithm this listener is registered to exits (maybe successfully, maybe not).booleancopyBMatrixFile()This method copies the optional b matrix file that user provided, and copies it to proc dir and renames it to the correct naming syntax.booleancreateBMatrixFileDICOM()This method creates the b-matrix file.booleancreateBMatrixFileParRec()This method creates the B-Matrix filebooleancreateListFileDICOM()This method creates the list file.booleancreateListFileParRec()This method creates the list file.booleancreatePathFileDICOM()This method creates the path file.booleancreatePathFileForInterleavedDICOM()This method creates the path file for interleaverd datasetsbooleancreatePathFileParRec()This method creates the path filebooleancreateProcDirAndImageSlicesDirParRec()this method creates the proc dir in which the list file, path file, and b-matrix file go.booleancreateProcDirDICOM()this method creates the proc dir in which the list file, path file, and b-matrix file go.booleancreateSubDirsInRegisteredDir(java.io.File dir)booleandeleteAllFiles(java.io.File dir)voidfinalize()this method cleans up the proc dir if success is false and it sets the lists to null.booleanobtainBValuesDICOM()This method obtains the b-values for each volume from either the public tag or the private tag.booleanobtainListFileDataParRec()This method obtains list file data mostly from the 1st slicebooleanparse(java.io.File file)this method parses the study dir sort into lists using series number that is available in dicom tag. then based on the filename, get vol number (for example mipav_dicom_dti_series11_volume10005.dcm), and sort within lists using vol number and instance number that comes from dicom tag.booleanperformRegistrationDICOM()regsitration of DICOM DWI datasetbooleanperformRegistrationPARREC()regsitration of PAR REC DWI datasetbooleanreadGradientFileDICOM()This method reads in the gradient file gradient file can be in 2 differetn ways....for eDTI, there will be a number on first line followed by correct number of gradients if it is DTI, there will be no number and just 7 linies of gradients....this needs to be duplicated as many times as there are series.booleanreadGradientFileParRec()this method reads the gradient filebooleanregisterAndSaveVolumes(java.io.File dir)voidrunAlgorithm()Actually runs the algorithm.voidrunAlgorithmDICOM()run algorithm for dicomvoidrunAlgorithmPARREC()run algorithm for par/recbooleansetInitialInfo()this method sets initial info about the study.booleanwriteImageSlicesParRec()This method writes out the image slices as raw float-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, generateProgressValues, getDestImage, getElapsedTime, getMask, getMaxProgressValue, getMinProgressValue, getNumberOfThreads, getProgress, getProgressChangeListener, getProgressChangeListeners, getProgressModulus, getProgressStep, getProgressValues, getSrcImage, isCompleted, isImage25D, isMultiThreadingEnabled, isRunningInSeparateThread, isThreadStopped, linkProgressToAlgorithm, linkProgressToAlgorithm, makeProgress, notifyListeners, removeListener, removeProgressChangeListener, run, setCompleted, setImage25D, setMask, setMaxProgressValue, setMinProgressValue, setMultiThreadingEnabled, setNumberOfThreads, setProgress, setProgressModulus, setProgressStep, setProgressValues, setProgressValues, setRunningInSeparateThread, setSrcImage, setStartTime, setThreadStopped, startMethod, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
studyName
private java.lang.String studyName
This is the dir name of the study.*
-
studyPath
private java.lang.String studyPath
This is the full path of the study.*
-
prFileName
private java.lang.String prFileName
par rec file name
-
prFileDir
private java.lang.String prFileDir
par rec file dir
-
gradientFilePath
private java.lang.String gradientFilePath
This is the full path to the gradient file.*
-
bmtxtFilePath
private java.lang.String bmtxtFilePath
This is the full path to the b matrix file.*
-
isInterleaved
private boolean isInterleaved
boolean if dataset is interelaved
-
outputTextArea
private javax.swing.JTextArea outputTextArea
TextArea of main dialog for text output.*
-
dwiPathTextField
private javax.swing.JTextField dwiPathTextField
handle to dwi data textfield of main dialog
-
seriesFileInfoTreeMap
private java.util.TreeMap<java.lang.Integer,java.util.TreeSet<java.lang.String[]>> seriesFileInfoTreeMap
This is an ordered map of series number and seriesFileInfoTreeSet.*
-
seriesFileInfoTreeSet
private java.util.TreeSet<java.lang.String[]> seriesFileInfoTreeSet
This is an ordered list of files per series number.*
-
isDICOM
private boolean isDICOM
boolean indicating if we are dealing with dicom or par/rec
-
listFileName
private java.lang.String listFileName
List file name
-
bmatrixFileName
private java.lang.String bmatrixFileName
B Matrix file name
-
pathFileName
private java.lang.String pathFileName
Path File name
-
success
private boolean success
flag indicating if method was successful.*
-
totalImageSlices
private int totalImageSlices
total image slices.*
-
totalNumVolumes
private int totalNumVolumes
total num of volumes in study.*
-
isEDTI
private boolean isEDTI
boolean telling if dataset is eDTI.*
-
isGE
private boolean isGE
boolean telling if datset is GE.*
-
isSiemens
private boolean isSiemens
boolean telling if datset is SIEMENS.*
-
firstFileInfoDicom
private FileInfoDicom firstFileInfoDicom
first fileinfo dicom...used for list file info.*
-
geSoftwareVersion
private int geSoftwareVersion
int telling software version if datset is GE.*
-
imageFilter
private ViewImageFileFilter imageFilter
This is the image filter needed to select the correct dicom images.*
-
dicomInfo
private java.lang.String[] dicomInfo
Array that holds the dicom tag info*
-
isProcDirCreated
private boolean isProcDirCreated
boolean if proc dir was created.*
-
numSlicesPerVolume
private int numSlicesPerVolume
this is the number of image slices per volume.*
-
nim
private int nim
this is the number of gradient quantities that is obtained by reading first line of gradient file.*
-
direction
private float[][] direction
this is the gradient matrix that is populated when reading the gradient file.*
-
bValuesArrayList
private java.util.ArrayList<java.lang.Float> bValuesArrayList
this is an array of b-values that for each volume.*
-
fileParRec
private FilePARREC fileParRec
FileParRec handle
-
fileInfoPR
private FileInfoPARREC fileInfoPR
file info Par/Rec
-
image4D
private ModelImage image4D
ModelImage of 4D par/rec dataset
-
originalColumnsString
private java.lang.String originalColumnsString
x dim
-
originalRowsString
private java.lang.String originalRowsString
y dim
-
numSlicesString
private java.lang.String numSlicesString
z dim
-
nimString
private java.lang.String nimString
t dim
-
phaseEncodingString
private java.lang.String phaseEncodingString
phase encoding...hard coded to vertical
-
horizontalFOVString
private java.lang.String horizontalFOVString
horizontal FOV
-
verticalFOVString
private java.lang.String verticalFOVString
vertical FOV
-
sliceGapString
private java.lang.String sliceGapString
slice gap String
-
sliceThicknessString
private java.lang.String sliceThicknessString
sliec thickness
-
imageOrientationString
private java.lang.String imageOrientationString
image orientation
-
volParameters
private java.util.HashMap<java.lang.String,java.lang.String> volParameters
vol parameters
-
avgVolIndex
private int avgVolIndex
Philips puts in one volume as the average of all the DWIs. This volume will have a non-zero B value and 0 in the gradients Once we find this volume, exclude it.... this int represents which volume index to exclude
-
isOldVersion
private boolean isOldVersion
boolean identifying if par/rec datset is older than version 4.1
-
oldVersionGradientsAL
private java.util.ArrayList<java.lang.String[]> oldVersionGradientsAL
arraylist of gradients for version 4 of Par/Rec
-
nimCounter
private int nimCounter
this counter is used for version 4 of Par/Rec...nim is calculated from gradient file
-
imageSlicesDirPath
private java.lang.String imageSlicesDirPath
path for imageSlicesDir
-
relativeImageSlicesDirPath
private java.lang.String relativeImageSlicesDirPath
relative path for slices dir for outputting to path file
-
rawImageFormatString
private java.lang.String rawImageFormatString
raw image format...hardcoded to float since we will be outputting par/rec slices in float format
-
unsortedPathsArrayList
private java.util.ArrayList<java.lang.String> unsortedPathsArrayList
arraylist of unsorted path strings to image slices
-
xDim
private int xDim
xDIm of 4d image
-
yDim
private int yDim
yDim of 4d image
-
zDim
private int zDim
zDim of 4d image
-
tDim
private int tDim
tDim of 4d image
-
performRegistration
private boolean performRegistration
boolean for performing registration
-
reg35
private AlgorithmRegOAR35D reg35
handle to AlgorithmRegOAR35D
-
reg3
private AlgorithmRegOAR3D reg3
handle to AlgorithmRegOAR3D
-
cost
private int cost
registration option parameters
-
DOF
private int DOF
registration option parameters
-
interp
private int interp
registration option parameters
-
interp2
private int interp2
registration option parameters
-
registerTo
private int registerTo
registration option parameters
-
maxIterations
private int maxIterations
registration option parameters
-
numMinima
private int numMinima
registration option parameters
-
rotateBegin
private float rotateBegin
registration option parameters
-
rotateEnd
private float rotateEnd
registration option parameters
-
coarseRate
private float coarseRate
registration option parameters
-
fineRate
private float fineRate
registration option parameters
-
rotateBeginX
private float rotateBeginX
registration option parameters
-
rotateEndX
private float rotateEndX
registration option parameters
-
coarseRateX
private float coarseRateX
registration option parameters
-
fineRateX
private float fineRateX
registration option parameters
-
rotateBeginY
private float rotateBeginY
registration option parameters
-
rotateEndY
private float rotateEndY
registration option parameters
-
coarseRateY
private float coarseRateY
registration option parameters
-
fineRateY
private float fineRateY
registration option parameters
-
rotateBeginZ
private float rotateBeginZ
registration option parameters
-
rotateEndZ
private float rotateEndZ
registration option parameters
-
coarseRateZ
private float coarseRateZ
registration option parameters
-
fineRateZ
private float fineRateZ
registration option parameters
-
doGraph
private boolean doGraph
registration option parameters
-
doSubsample
private boolean doSubsample
registration option parameters
-
doMultiThread
private boolean doMultiThread
registration option parameters
-
fastMode
private boolean fastMode
registration option parameters
-
maxOfMinResol
private boolean maxOfMinResol
registration option parameters
-
dicomB0VolumePath
private java.lang.String dicomB0VolumePath
path to dicom B0 for registration purposes
-
refImage
private ModelImage refImage
model images
-
matchImage
private ModelImage matchImage
model images
-
resultImage
private ModelImage resultImage
model images
-
fileIO
private FileIO fileIO
file IO
-
registeredStudyName
private java.lang.String registeredStudyName
study name for registered data set
-
transform
private AlgorithmTransform transform
handle to AlgorithmTransform
-
xdimA
private int xdimA
parameter for AlgorithmTransform
-
ydimA
private int ydimA
parameter for AlgorithmTransform
-
zdimA
private int zdimA
parameter for AlgorithmTransform
-
xresA
private float xresA
parameter for AlgorithmTransform
-
yresA
private float yresA
parameter for AlgorithmTransform
-
zresA
private float zresA
parameter for AlgorithmTransform
-
registeredDicomB0VolumePathParentFolder
private java.lang.String registeredDicomB0VolumePathParentFolder
registered B0 parent folder
-
-
Constructor Detail
-
AlgorithmDTICreateListFile
public AlgorithmDTICreateListFile(java.lang.String studyPath, java.lang.String studyName, java.lang.String gradientFilePath, java.lang.String bmtxtFilePath, javax.swing.JTextArea outputTextArea, boolean isInterleaved, boolean performRegsitration)constructor for dicom- Parameters:
studyPath-studyName-gradientFilePath-bmtxtFilePath-outputTextArea-
-
AlgorithmDTICreateListFile
public AlgorithmDTICreateListFile(java.lang.String studyPath, java.lang.String studyName, java.lang.String dicomB0VolumePath, java.lang.String gradientFilePath, java.lang.String bmtxtFilePath, javax.swing.JTextArea outputTextArea, boolean isInterleaved, boolean performRegsitration, int cost, int DOF, int interp, int interp2, float rotateBeginX, float rotateEndX, float coarseRateX, float fineRateX, float rotateBeginY, float rotateEndY, float coarseRateY, float fineRateY, float rotateBeginZ, float rotateEndZ, float coarseRateZ, float fineRateZ, boolean maxOfMinResol, boolean doSubsample, boolean doMultiThread, boolean fastMode, int bracketBound, int maxIterations, int numMinima, javax.swing.JTextField dwiPathTextField)constructor for dicom if registration is to be done first- Parameters:
studyPath-studyName-gradientFilePath-bmtxtFilePath-outputTextArea-
-
AlgorithmDTICreateListFile
public AlgorithmDTICreateListFile(java.lang.String fileName, java.lang.String fileDir, java.lang.String gradientFilePath, java.lang.String bmtxtFilePath, javax.swing.JTextArea outputTextArea, boolean performRegsitration)constructor for par/rec
-
AlgorithmDTICreateListFile
public AlgorithmDTICreateListFile(java.lang.String fileName, java.lang.String fileDir, java.lang.String gradientFilePath, java.lang.String bmtxtFilePath, javax.swing.JTextArea outputTextArea, boolean performRegsitration, int cost, int DOF, int interp, int interp2, int registerTo, float rotateBegin, float rotateEnd, float coarseRate, float fineRate, boolean doSubsample, boolean doMultiThread, boolean fastMode, int bracketBound, int maxIterations, int numMinima, javax.swing.JTextField dwiPathTextField)constructor for par/rec if registration is to be done first
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm()
Description copied from class:AlgorithmBaseActually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithmin classAlgorithmBase
-
performRegistrationPARREC
public boolean performRegistrationPARREC()
regsitration of PAR REC DWI dataset
-
performRegistrationDICOM
public boolean performRegistrationDICOM()
regsitration of DICOM DWI dataset
-
registerAndSaveVolumes
public boolean registerAndSaveVolumes(java.io.File dir)
-
createSubDirsInRegisteredDir
public boolean createSubDirsInRegisteredDir(java.io.File dir)
-
deleteAllFiles
public boolean deleteAllFiles(java.io.File dir)
-
runAlgorithmDICOM
public void runAlgorithmDICOM()
run algorithm for dicom
-
runAlgorithmPARREC
public void runAlgorithmPARREC()
run algorithm for par/rec
-
setInitialInfo
public boolean setInitialInfo()
this method sets initial info about the study.- Returns:
- boolean success
-
parse
public boolean parse(java.io.File file) throws java.io.IOException, java.lang.OutOfMemoryErrorthis method parses the study dir sort into lists using series number that is available in dicom tag. then based on the filename, get vol number (for example mipav_dicom_dti_series11_volume10005.dcm), and sort within lists using vol number and instance number that comes from dicom tag.- Parameters:
file-- Returns:
- boolean success
- Throws:
java.io.IOExceptionjava.lang.OutOfMemoryError
-
createProcDirDICOM
public boolean createProcDirDICOM()
this method creates the proc dir in which the list file, path file, and b-matrix file go.- Returns:
- boolean success
-
createPathFileForInterleavedDICOM
public boolean createPathFileForInterleavedDICOM()
This method creates the path file for interleaverd datasets- Returns:
- boolean success
-
createPathFileDICOM
public boolean createPathFileDICOM()
This method creates the path file.- Returns:
- boolean success
-
createListFileDICOM
public boolean createListFileDICOM()
This method creates the list file.- Returns:
- boolean success
-
readGradientFileDICOM
public boolean readGradientFileDICOM()
This method reads in the gradient file gradient file can be in 2 differetn ways....for eDTI, there will be a number on first line followed by correct number of gradients if it is DTI, there will be no number and just 7 linies of gradients....this needs to be duplicated as many times as there are series.- Returns:
- boolean success
-
obtainBValuesDICOM
public boolean obtainBValuesDICOM()
This method obtains the b-values for each volume from either the public tag or the private tag.- Returns:
- boolean success
-
createBMatrixFileDICOM
public boolean createBMatrixFileDICOM()
This method creates the b-matrix file.- Returns:
- boolean success
-
obtainListFileDataParRec
public boolean obtainListFileDataParRec()
This method obtains list file data mostly from the 1st slice- Returns:
-
readGradientFileParRec
public boolean readGradientFileParRec()
this method reads the gradient file- Returns:
-
createProcDirAndImageSlicesDirParRec
public boolean createProcDirAndImageSlicesDirParRec()
this method creates the proc dir in which the list file, path file, and b-matrix file go.- Returns:
- boolean success
-
createListFileParRec
public boolean createListFileParRec()
This method creates the list file.- Returns:
- boolean success
-
createBMatrixFileParRec
public boolean createBMatrixFileParRec()
This method creates the B-Matrix file- Returns:
-
writeImageSlicesParRec
public boolean writeImageSlicesParRec()
This method writes out the image slices as raw float- Returns:
-
createPathFileParRec
public boolean createPathFileParRec()
This method creates the path file- Returns:
-
finalize
public void finalize()
this method cleans up the proc dir if success is false and it sets the lists to null.- Overrides:
finalizein classAlgorithmBase
-
copyBMatrixFile
public boolean copyBMatrixFile()
This method copies the optional b matrix file that user provided, and copies it to proc dir and renames it to the correct naming syntax.- Returns:
- boolean
-
algorithmPerformed
public void algorithmPerformed(AlgorithmBase algorithm)
Description copied from interface:AlgorithmInterfaceCalled after an algorithm this listener is registered to exits (maybe successfully, maybe not). If the algorithm is run in a separate thread, this call will be made within that thread. If not, this call will be made from that same, shared thread.- Specified by:
algorithmPerformedin interfaceAlgorithmInterface- Parameters:
algorithm- the algorithm which has just completed
-
-