AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper Class Reference

Inheritance diagram for AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper:
object

List of all members.

Public Member Functions

def __init__
def AddImages
def BinarizeImageByLabel
def ConvertDirectoryToList
def ConvertDirectoryToString
def ConvertListToString
def CreateScript
def debug
def DeleteFilesAndDirectory
def Destructor
def DisplayImageInSlicer
def DivideImage
def EnableDebugMode
def Execute
def GetBRAINSFitRegistrationCommand
def GetBRAINSFitResampleCommand
def GetCMTKAffineRegistrationCommand
def GetCMTKInstallationDirectory
def GetCMTKNonRigidRegistrationCommand
def GetCMTKResampleCommand
def GetLabels
def GetSaveDeformationFieldCommand
def GetSlicerLaunchPrefix
def GetSlicerTemporaryDirectory
def GetValidFilePaths
def GuessBackgroundValue
def info
def LoadVolume
def MultiplyImage
def PCAGenerateDistanceMaps
def PCAGenerateModel
def ReadLabelsFromImage
def ReCastImage
def SaveVolume
def SourceTclFile

Private Attributes

 __debugMode
 __emlogic
 __parentClass
 __pcaDistanceSourced

Detailed Description

    The helper class for the Atlas Creator
==========================================================================================

Member Function Documentation

def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::__init__ (   self,
  parentClass 
)
    Initialize this class
    
    parentClass
a pointer to the parentClass

    Returns
n/a
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::AddImages (   self,
  imageData1,
  imageData2 
)
    Adds two images
    
    imageData1
vtkImageData
    imageData2
vtkImageData
    
    Returns
vtkImageData after addition
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::BinarizeImageByLabel (   self,
  imageData,
  labelValue 
)
    Binarize an image to 0 and 1, while just keeping the voxels with the labelValue
    
    imageData
vtkImageData
    labelValue
the value of the voxels to keep
    
    Returns
vtkImageData after binarizing
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::ConvertDirectoryToList (   self,
  directory 
)
    Convert a directory to a list of filePaths. While reading the directory,
    only real files are added to the list, sub-directories as well as links are ignored.
    
    directory
a String containing the path to the directory

    Returns
list of filePaths
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::ConvertDirectoryToString (   self,
  directory 
)
    Convert a directory to a string of filePaths with space as delimiter. While reading the directory,
    only real files are added to the list, sub-directories as well as links are ignored.
    
    directory
a String containing the path to the directory

    Returns
string of filePaths with space as delimiter
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::ConvertListToString (   self,
  list 
)
    Convert a list to a string of items with space as delimiter.
    
    list
a list object

    Returns
string of list items with space as delimiter
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::CreateScript (   self,
  commands,
  notify 
)
    Return a script based on template.sh where commands and notify were inserted properly.
    
    commands
A string containing the execution commands.
    notify
A string containing commands to execute before the script exits.

    Returns
The script where the arguments were inserted properly.
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::debug (   self,
  message 
)
    Print statement to stdout including a timestamp and a debug label
    
    message
value to print, will be casted to String
    
    Returns
n/a
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::DeleteFilesAndDirectory (   self,
  filePathList,
  wipe = False 
)
    Delete all files of a filePathList and also the directory
    
    filePathList
the list of file paths to delete
    wipe
if TRUE, wipe it without asking questions!
    
    Returns
TRUE or FALSE depending on success
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::Destructor (   self  ) 
    Destruct this class
    
    Returns
n/a
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::DisplayImageInSlicer (   self,
  filePath,
  nodeName 
)
    Displays an image in 3D Slicer and re-calculates Window/Level on the displayNode
    
    filePath
the file path to an existing image in any 3D Slicer readable format

    nodeName
the name of the new volume Node
    
    Returns
The ID of the MRML node as a String or None on failure
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::DivideImage (   self,
  imageData,
  dividend 
)
    Divide an image
    This includes automatic Re-Cast to Float
    
    imageData
vtkImageData
    dividend
the number to divide with, will be casted to float
    
    Returns
vtkImageData after division
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::EnableDebugMode (   self  ) 
    Enables the debug Mode
    
    Returns
n/a
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::Execute (   self,
  command 
)
    Execute a given command and print runtime information.
    
    command
A string containing the command to be executed

    Returns
n/a
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::GetBRAINSFitRegistrationCommand (   self,
  templateFilePath,
  movingImageFilePath,
  outputTransformFilePath,
  outputImageFilePath,
  onlyAffineReg,
  multiThreading,
  backgroundValue 
)
    Get the command to Register an image to a template using BRAINSFit
    
    templateFilePath
the file path to the template (target) image
    movingImageFilePath
the file path to the moving image
    outputTransformFilePath
the file path to the transformation output
    outputImageFilePath
the file path to the aligned image output
    onlyAffineReg
if true, just use affine registration and no BSpline
    multiThreading
if true, use multi threading
    backgroundValue
the backgroundValue of the moving image                

    Returns
the command to Register an image
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::GetBRAINSFitResampleCommand (   self,
  segmentationFilePath,
  templateFilePath,
  transformFilePath,
  outputSegmentationFilePath,
  backgroundValue 
)
    Get the command to Resample a segmentation using BRAINSFit
    
    segmentationFilePath
the file path to the segmentation
    templateFilePath
the file path to the template used to define the output space
    transformFilePath
the file path to the existing transformation          
    outputSegmentationFilePath
the file path to the resampled segmentation output
    backgroundValue
the backgroundValue of the segmentation                

    Returns
the command to Resample a segmentation
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::GetCMTKAffineRegistrationCommand (   self,
  templateFilePath,
  movingImageFilePath,
  outputTransformDirectory,
  outputImageFilePath,
  backgroundValue,
  backgroundValueTemplate 
)
    Get the command to Register an image to a template using CMTK
    
    templateFilePath
the file path to the template (target) image
    movingImageFilePath
the file path to the moving image
    outputTransformDirectory
the file path to the directory for transformation output
    outputImageFilePath
the file path to the aligned image output
    backgroundValue
the backgroundValue of the moving image
    backgroundValueTemplae
the backgroundValue of the template                

    Returns
the command to Register an image using CMTK in Affine mode
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::GetCMTKInstallationDirectory (   self  ) 
    Return the installation directory of the CMTK extension.
    
    Returns
The installation directory as String or None if CMTK was not found
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::GetCMTKNonRigidRegistrationCommand (   self,
  templateFilePath,
  movingImageFilePath,
  outputTransformDirectory,
  outputImageFilePath,
  backgroundValue,
  backgroundValueTemplate 
)
    Get the command to Register an image to a template using CMTK
    
    templateFilePath
the file path to the template (target) image
    movingImageFilePath
the file path to the moving image
    outputTransformDirectory
the file path to the directory for transformation output, here it will be also used as input for the affine transformation
    outputImageFilePath
the file path to the aligned image output
    backgroundValue
the backgroundValue of the moving image
    backgroundValueTemplae
the backgroundValue of the template                

    Returns
the command to Register an image using CMTK in NonRigid mode
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::GetCMTKResampleCommand (   self,
  segmentationFilePath,
  templateFilePath,
  transformDirectory,
  outputSegmentationFilePath,
  backgroundValue 
)
    Get the command to Resample a segmentation using CMTK
    
    segmentationFilePath
the file path to the segmentation
    templateFilePath
the file path to the template used to define the output space
    transformDirectory
the file path to the existing transformation directory         
    outputSegmentationFilePath
the file path to the resampled segmentation output
    backgroundValue
the backgroundValue of the segmentation                
    
    Returns
the command to Resample a segmentation
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::GetLabels (   self,
  labelMap 
)
    Get the list of labels in a labelMap
    
    labelMap
vtkImageData of a labelMap volume
    
    Returns
the list of labels
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::GetSaveDeformationFieldCommand (   self,
  movingImageFilePath,
  transformFilePath,
  outputDeformationFieldFilePath 
)
    Get the command to Save a deformation field
    
    movingImageFilePath
the file path to the moving image used as the reference image
    transformFilePath
the file path to the existing BSpline transformation
    outputDeformationFieldFilePath
the file path to the Deformation Field output

    Returns
the command to save a deformation field
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::GetSlicerLaunchPrefix (   self,
  useCMTK = False,
  justLauncher = False 
)
    Get the path to the 3D Slicer launcher ready to start a plugin. (OS independent)
    
    useCMTK
If TRUE, add the CMTK directory instead of the Plugin Directory
    justLauncher
If TRUE, just return the path to the Slicer launcher
    
    Returns
the path to the 3D Slicer launcher configured to start a plugin as a String
f.e. /home/user/Slicer3-build/Slicer3 --launch /home/user/Slicer3-build/lib/Slicer3/Plugins/
If useCMTK is TRUE:
f.e. /home/user/Slicer3-build/Slicer3 --launch /home/user/Slicer3user/@SVNREV@/CMTK4Slicer
pay attention to the trailing /
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::GetSlicerTemporaryDirectory (   self  ) 
    Get the path to the 3D Slicer temporary directory
    
    Returns
the path to the 3D Slicer temporary directory as a String
pay attention to the trailing /
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::GetValidFilePaths (   self,
  list1,
  list2 
)
    Returns list1 without any files which baseNames are not in list2.
    
    list1, list2
list of filePaths

    Returns
list1 without invalid entries
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::GuessBackgroundValue (   self,
  filePath 
)
    Guesses the background value for a given image
    
    filePath
the filepath to an existing image
    
    Returns
The guess for a background value
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::info (   self,
  message 
)
    Print statement to stdout including a timestamp
    
    message
value to print, will be casted to String
    
    Returns
n/a
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::LoadVolume (   self,
  filePath 
)
    Loads an image as a MRMLScalarVolumeNode and adds it to the MRML Scene
    
    filePath
the file path to an existing image in any 3D Slicer readable format
    
    Returns
vtkMRMLScalarVolumeNode containing the loaded image and meta information
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::MultiplyImage (   self,
  imageData,
  factor 
)
    Multiply an image
    This includes automatic Re-Cast to Float
    
    imageData
vtkImageData
    dividend
the number to divide with, will be casted to float
    
    Returns
vtkImageData after multiplication
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::PCAGenerateDistanceMaps (   self,
  imageFilePath,
  label,
  outputFilePath,
  dryRun = 0,
  maxDist = 100,
  distBound = 10 
)
    Calls the PCADistance function
   
    imageFilePath
filePath to an existing image
    label
Label to use for PCA
    outputFilePath
output filePath to the generated distance map
    
   
    Returns
n/a
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::PCAGenerateModel (   self,
  pcaDirectory,
  labelList,
  dryRun = 0,
  maxNumberOfEigenVectors = 10,
  saveFileFormat = "nrrd",
  combineStructures = 0 
)
    Calls the PCAGenerate function
   
    pcaDirectory
filePath to a directory containing appropriate distanceMaps
    labelList
list of labels to use for PCA
   
    Returns
       n/a
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::ReadLabelsFromImage (   self,
  path 
)
Read labels from an image.

path - the filePath to an existing Image

Returns a list of labels
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::ReCastImage (   self,
  imageData,
  castString 
)
    Re-Cast an image to a different type
    
    imageData
vtkImageData
    castString
New type as a String, possible values are
"Char"
"Unsigned Char"
"Double"
"Float"
"Int"
"Unsigned Int"
"Long"
"Unsigned Long"
"Short"
"Unsigned Short"
other values will result in "Short"

    Returns
vtkImageData after Re-Cast
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::SaveVolume (   self,
  filePath,
  volumeNode 
)
    Saves a MRMLScalarVolumeNode
    
    filePath
the file path to save a MRMLScalarVolumeNode in any 3D Slicer readable format
    
    volumeNode
vtkMRMLScalarVolumeNode to save
    
    Returns
TRUE or FALSE depending on success
def AtlasCreator::AtlasCreatorHelper::AtlasCreatorHelper::SourceTclFile (   self,
  filePath 
)
    Sources a TclFile
    
    filePath
the filepath to an existing tcl file
    
    Returns
n/a

Member Data Documentation


The documentation for this class was generated from the following file:

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1