SMILX  1.01
Public Types | Public Member Functions | Public Attributes | List of all members
milx::Registration Class Reference

Public Types

enum  RegistrationMode {
  ALADIN_RIGID =0, ITK_RIGID =1, ALADIN_AFFINE =2, ITK_AFFINE =3,
  ALADIN_DIFFDEMONS =4, ITK_AFFINEBSPLINE =5, ALIBABA_RIGID =6, ALIBABA_AFFINE =7,
  ALADIN_MILXBSPLINE =8, NIFTI_REG =9, NIFTI_ALADIN_REG =10, ITK_AFFINE_DIFFDEMONS =11,
  ITKALADIN_DIFFDEMONS =12, DIFFDEMONS =13
}
 
enum  InterpolateMode { INTERP_NEAREST =0, INTERP_LINEAR =1, INTERP_BSPLINE =2, INTERP_BSPLINE5 =3 }
 
enum  ConsensusMode { VOTING =0, MULTISTAPLE =1 }
 
typedef float InputPixelType
 
typedef float OutputPixelType
 
typedef itk::Vector< InputPixelType, 3 > VectorPixelType
 
typedef itk::Image< VectorPixelType, 3 > DemonsDeformationFieldType
 
typedef itk::Image< InputPixelType, 3 > InputImageType
 
typedef itk::Image< OutputPixelType, 3 > OutputImageType
 
typedef itk::NearestNeighborInterpolateImageFunction< InputImageType, double > NearestNeighborInterpolatorType
 
typedef itk::LinearInterpolateImageFunction< InputImageType, double > LinearInterpolatorType
 
typedef itk::BSplineInterpolateImageFunction< InputImageType, double, double > BsplineInterpolatorType
 
typedef itk::Vector< float, 3 > VectorType
 
typedef itk::OrientedImage< InputPixelType, 3 > FixedImageType
 
typedef itk::OrientedImage< InputPixelType, 3 > MovingImageType
 
typedef itk::OrientedImage< VectorType, 3 > FieldType
 
typedef itk::NearestNeighborInterpolateImageFunction< FixedImageType, double > NearestNeighborOrientatedInterpolatorType
 
typedef itk::LinearInterpolateImageFunction< FixedImageType, double > LinearOrientatedInterpolatorType
 
typedef itk::BSplineInterpolateImageFunction< FixedImageType, double, double > BsplineOrientatedInterpolatorType
 

Public Member Functions

void writeFile3D (FixedImageType::Pointer image, std::string outputFileName)
 
FixedImageType::Pointer readFile3D (std::string fileName)
 
bool LoadSettings (std::string)
 
int GetNumberOfCases ()
 
int GetNumberOfCases2 ()
 
int GetNumberOfAtlases ()
 
int GetNumberOfLabellings ()
 
std::vector< int > GetCaseIDs ()
 
std::vector< std::string > GetCaseFileNames ()
 
std::vector< std::string > GetCaseFileNames2 ()
 
std::string GetCaseFileName (int caseID)
 
std::string GetCaseFileName2 (int caseID)
 
std::vector< int > GetAtlasIDs ()
 
std::vector< std::string > GetAtlasFileNames ()
 
std::string GetAtlasFileName (int caseID)
 
std::vector< int > GetLabellingIDs ()
 
std::vector< std::string > GetLabellingFileNames ()
 
std::vector< std::string > GetLabellingFileNames (int caseID)
 
std::vector< std::string > GetPropagatedOutputAtlases ()
 
std::vector< std::string > GetPropagatedOutputTransforms ()
 
std::string GetPropagatedOutputAtlases (int caseID)
 
std::vector< std::string > GetPropagatedOutputLabels ()
 
std::vector< std::string > GetPropagatedOutputLabels (int caseID)
 
bool ClearPropagatedOutputAtlasesLabels ()
 
bool SetCase (int caseID, std::string filenames)
 
bool SetCases (std::vector< int > caseIDs, std::vector< std::string > caseFilenames)
 
bool SetCasePair (int caseID, std::string filenames, std::string filenames2)
 
bool SetCasesPair (std::vector< int > caseIDs, std::vector< std::string > caseFilenames, std::vector< std::string > caseFilenames2)
 
bool ClearCases ()
 
bool SetAtlases (std::vector< int > atlasIDs, std::vector< std::string > atlasFilenames)
 
bool SetAtlas (int atlasIDs, std::string atlasFilenames)
 
bool SetAtlases (std::vector< int > atlasIDs, std::vector< std::string > atlasFilenames, std::vector< int > labellingIDs, std::vector< std::string > labellingFilenames)
 
bool SetAtlases (std::vector< int > atlasIDs, std::vector< std::string > atlasFilenames, std::vector< int > labellingIDs, std::vector< std::string > labellingFilenames, std::vector< int > maskIDs, std::vector< std::string > maskFilenames)
 
bool SetAtlases (std::vector< int > atlasIDs, std::vector< std::string > atlasFilenames, std::vector< int > labellingIDs, std::vector< std::string > labellingFilenames, std::vector< int > maskIDs, std::vector< std::string > maskFilenames, std::vector< std::string > maskFilenames2)
 
bool SetAtlas (int atlasIDs, std::string atlasFilenames, std::vector< std::string > labellingFilenames)
 
bool ClearAtlases ()
 
void SetOutputPrefix (std::string prefix)
 
std::string GetOutputPrefix ()
 
bool SetRegistrationInterpolation (InterpolateMode mode)
 
bool SetAtlasInterpolation (InterpolateMode mode)
 
bool SetLabelledImageInterpolation (InterpolateMode mode)
 
bool SetLabelledImageInterpolation (std::vector< InterpolateMode > modes)
 
void SetUseConsensus (bool flag)
 
bool GetUseConsensus ()
 
bool SetRegistrationMode (int registrationScheme, std::string configFilename="NULL")
 
bool SetRegistrationMode (RegistrationMode registrationScheme, std::string)
 
RegistrationMode GetRegistrationMode ()
 
bool SetConsensusMode (int consensusScheme, std::string configFilename="NULL")
 
bool SetConsensusMode (ConsensusMode consensusScheme, std::string)
 
ConsensusMode GetConsensusMode ()
 
bool ConfigureRegistration (RegistrationMode, std::string)
 
void SetFilesToSave (int value)
 
void UpdatePipeline ()
 
void Voting (std::vector< std::string > inputFilenames, std::string outputFilename, int modulo, int N, ConsensusMode consensusMode)
 
bool RegisterRigidITK (std::string dataFile, std::string atlasFile, std::string outputPrefix, bool Invert, std::string dataMaskFile, std::string atlasMaskFile)
 
bool RegisterMilxNonRigid (std::string dataFile, std::string atlasFile, std::string outputName, bool Invert)
 
bool RegisterAffineITK (std::string dataFile, std::string atlasFile, std::string outputPrefix, bool Invert, std::string dataMaskFile, std::string atlasMaskFile)
 
bool RegisterNonRigidBsplineITK (std::string dataFile, std::string atlasFile, std::string outputPrefix, bool Invert, std::string dataMaskFile, std::string atlasMaskFile)
 
double NmiITK (std::string dataFile, std::string atlasFile)
 
void LoadTRSF (std::string filename1, std::string filename2, double *array, bool invert)
 
void LoadTRSF (std::string filename, double *array, bool invert)
 
bool PropagateAffine (std::string dataFile, std::string outFile, std::string targetFile, double *array, InterpolateMode mode, itk::SpatialOrientation::ValidCoordinateOrientationFlags &flag, itk::SpatialOrientationAdapter::DirectionType &dir)
 
bool PropagateITKRigid (std::string dataFile, std::string outFile, std::string targetFile, std::string transformFile, InterpolateMode mode)
 
bool PropagateITKAffine (std::string dataFile, std::string outFile, std::string targetFile, std::string transformFile, InterpolateMode mode)
 
bool PropagateITKAffineBspline (std::string inputImage, std::string targetFile, std::string outputFilename, std::string inputTransform, std::string inputBsplineTransform, InterpolateMode mode)
 
unsigned int StringToCharArray (std::string &cmdline, char **argument)
 

Public Attributes

std::vector< int > m_AtlasIDs
 
std::vector< std::string > m_AtlasFilenames
 
std::vector< int > m_LabellingIDs
 
std::vector< std::string > m_LabellingFilenames
 
std::vector< int > m_MaskIDs
 
std::vector< std::string > m_MaskFilenames
 
std::vector< std::string > m_MaskFilenames2
 
std::vector< int > m_CaseIDs
 
std::vector< std::string > m_CaseFilenames
 
std::vector< std::string > m_CaseFilenames2
 
std::string m_OutputPrefix
 
std::vector< std::string > m_PropagatedAtlases
 
std::vector< std::string > m_PropagatedLabelling
 
std::vector< std::string > m_PropagatedTransforms
 
InterpolateMode m_RegistrationInterpolation
 
InterpolateMode m_AtlasInterpolation
 
InterpolateMode m_LabelledImageInterpolation
 
std::vector< InterpolateMode > m_MultipleLabelledImageInterpolation
 
RegistrationMode m_RegistrationMode
 
bool m_UseConsensus
 
ConsensusMode m_ConsensusMode
 
int m_SaveFiles
 
NearestNeighborInterpolatorType::Pointer m_NearestNeighborInterpolator
 
LinearInterpolatorType::Pointer m_LinearInterpolator
 
BsplineInterpolatorType::Pointer m_BsplineInterpolator
 
NearestNeighborOrientatedInterpolatorType::Pointer m_NearestNeighborOrientatedInterpolator
 
LinearOrientatedInterpolatorType::Pointer m_LinearOrientatedInterpolator
 
BsplineOrientatedInterpolatorType::Pointer m_BsplineOrientatedInterpolator
 

Detailed Description

Definition at line 70 of file milxRegistration.h.

Member Function Documentation

◆ ConfigureRegistration()

bool milx::Registration::ConfigureRegistration ( RegistrationMode  ,
std::string   
)
inline

Options to configure individual schemes (ie if not using config file).

Definition at line 606 of file milxRegistration.h.

◆ GetNumberOfCases()

int milx::Registration::GetNumberOfCases ( )
inline

Various Get Calls

Definition at line 144 of file milxRegistration.h.

◆ GetPropagatedOutputAtlases()

std::vector<std::string> milx::Registration::GetPropagatedOutputAtlases ( )
inline

Return the list of final output filenames for the propagated atlases and labels

  • As multiple

Definition at line 250 of file milxRegistration.h.

◆ LoadSettings()

bool milx::Registration::LoadSettings ( std::string  )
inline

Configure registration class

  • Allows everything to be configured via one txt file.
  • ie load IDs, images, atlases, labellings, RegistrationMode, Registration Setting filename

Definition at line 136 of file milxRegistration.h.

◆ readFile3D()

Registration::FixedImageType::Pointer milx::Registration::readFile3D ( std::string  fileName)

readFile3D reads in a 3D file of the specified name

Parameters
fileNamethe path of the file
Returns
an ITK smart pointer to the image

Definition at line 2648 of file milxRegistration.cxx.

◆ RegisterRigidITK()

bool milx::Registration::RegisterRigidITK ( std::string  dataFile,
std::string  atlasFile,
std::string  outputPrefix,
bool  Invert,
std::string  dataMaskFile,
std::string  atlasMaskFile 
)

Various code that requires refactoring

  • Note: In the future, the below should probably be implemented in a factory !

Definition at line 729 of file milxRegistration.cxx.

◆ SetAtlases()

bool milx::Registration::SetAtlases ( std::vector< int >  atlasIDs,
std::vector< std::string >  atlasFilenames 
)
inline

Set/Clear list of atlases, labellings and IDs

  • Case IDs should be unique.
  • Note: Labelling IDs are assumed to correspond to caseIDs
  • Previous Atlases will be removed.

Definition at line 339 of file milxRegistration.h.

◆ SetCase()

bool milx::Registration::SetCase ( int  caseID,
std::string  filenames 
)
inline

Set/Clear list of images to register or co-register

Definition at line 295 of file milxRegistration.h.

◆ SetConsensusMode()

bool milx::Registration::SetConsensusMode ( int  consensusScheme,
std::string  configFilename = "NULL" 
)
inline

Set Consensus Mode

Definition at line 577 of file milxRegistration.h.

◆ SetFilesToSave()

void milx::Registration::SetFilesToSave ( int  value)
inline

Options to enable the amount of files to remain

  • 5 or more saves all files (default)
  • 4 do not save deformation fields
  • 3 do not save propagated atlases
  • 2 do not save transforms
  • 1 do not save propagated labels
  • 0 should save nothing

Definition at line 620 of file milxRegistration.h.

◆ SetOutputPrefix()

void milx::Registration::SetOutputPrefix ( std::string  prefix)
inline

Set Output prefix

  • Note: this supports the use of /tmp/CASEID/case_CASEID_with_ATLASID_

Definition at line 430 of file milxRegistration.h.

◆ SetRegistrationInterpolation()

bool milx::Registration::SetRegistrationInterpolation ( InterpolateMode  mode)
inline

SetInterpolation used for each step

Definition at line 443 of file milxRegistration.h.

◆ SetRegistrationMode()

bool milx::Registration::SetRegistrationMode ( int  registrationScheme,
std::string  configFilename = "NULL" 
)
inline

Set Registration scheme to use.

Definition at line 482 of file milxRegistration.h.

◆ SetUseConsensus()

void milx::Registration::SetUseConsensus ( bool  flag)
inline

Enable/Disable the use of Voting

  • By default disabled

Definition at line 470 of file milxRegistration.h.

◆ UpdatePipeline()

void milx::Registration::UpdatePipeline ( )
inline

Not used in this code

Definition at line 628 of file milxRegistration.h.

◆ writeFile3D()

void milx::Registration::writeFile3D ( FixedImageType::Pointer  image,
std::string  outputFileName 
)

writeFile outputs a 3D image

Parameters
imagean ITK smart pointer to the image
outputFileNamethe path of the file

Definition at line 2626 of file milxRegistration.cxx.

Member Data Documentation

◆ m_AtlasIDs

std::vector<int> milx::Registration::m_AtlasIDs

Variables used by this class;

Definition at line 628 of file milxRegistration.h.

◆ m_NearestNeighborInterpolator

NearestNeighborInterpolatorType::Pointer milx::Registration::m_NearestNeighborInterpolator

Declare interpolators

Definition at line 666 of file milxRegistration.h.


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