Class AlgorithmDICOMtoAVI
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.utilities.AlgorithmDICOMtoAVI
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.awt.event.WindowListener,java.lang.Runnable,java.util.EventListener
public class AlgorithmDICOMtoAVI extends AlgorithmBase
Recursively traverses a directory and its subfolders, converting all 3D DICOM files to AVI with MP42 Compression.- Version:
- 1.0
- Author:
- Ben Link
-
-
Field Summary
Fields Modifier and Type Field Description private intcompressionDOCUMENT ME!private java.lang.StringdirPathDirectory to recursively operate in.private FileIOfileIODOCUMENT ME!private java.lang.StringoutputPathOutput path to build new tree.private floatqualityDOCUMENT ME!-
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 AlgorithmDICOMtoAVI(java.lang.String dir, java.lang.String outputDir, int compression)Default Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddFilesToVector(java.lang.String name, java.util.Vector<java.lang.String> vec)Recursively adds DICOM filenames and directory paths to a Vector.voidrunAlgorithm()DOCUMENT ME!private voidrunConversion(java.lang.String fileName)Opens a dicom image, checks to see if it is 3d, adds margins if the image dimensions are not multiples of 4, and saves the image as an AVI with MP42 compression**note - the directory structure is intact with the only difference being that the name of the top level directory now has "_AVI" appended.voidsetQuality(float q)DOCUMENT ME!-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, finalize, 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
-
compression
private int compression
DOCUMENT ME!
-
dirPath
private java.lang.String dirPath
Directory to recursively operate in.
-
fileIO
private FileIO fileIO
DOCUMENT ME!
-
outputPath
private java.lang.String outputPath
Output path to build new tree.
-
quality
private float quality
DOCUMENT ME!
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm()
DOCUMENT ME!- Specified by:
runAlgorithmin classAlgorithmBase
-
setQuality
public void setQuality(float q)
DOCUMENT ME!- Parameters:
q- DOCUMENT ME!
-
addFilesToVector
private void addFilesToVector(java.lang.String name, java.util.Vector<java.lang.String> vec)Recursively adds DICOM filenames and directory paths to a Vector.- Parameters:
name- The name of either file or directoryvec- Vector that holds all files to be processed
-
runConversion
private void runConversion(java.lang.String fileName)
Opens a dicom image, checks to see if it is 3d, adds margins if the image dimensions are not multiples of 4, and saves the image as an AVI with MP42 compression**note - the directory structure is intact with the only difference being that the name of the top level directory now has "_AVI" appended.- Parameters:
fileName- name of file to convert
-
-