+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
- Main authors : XX XX XX
-
- Authors belongs to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
- - BSD http://www.opensource.org/licenses/bsd-license.php
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-
- =========================================================================*/
-
-#include "clitkImage2DicomRTStructFilter.h"
-#include "clitkDicomRT_StructureSet.h"
-#include "clitkImage2DicomRTStruct_ggo.h"
-
-//--------------------------------------------------------------------
-int main(int argc, char * argv[]) {
-
- // Init command line
- GGO(clitkImage2DicomRTStruct, args_info);
-
- // Read initial 3D image
- typedef float PixelType;
- typedef itk::Image<PixelType, 3> ImageType;
- ImageType::Pointer input = clitk::readImage<ImageType>(args_info.input_arg, true);
-
- // Create a filter to convert image into dicomRTStruct
- clitk::Image2DicomRTStructFilter<PixelType> filter;
- filter.SetInput(input);
- filter.Update();
-
- // Write result
- clitk::DicomRT_StructureSet::Pointer s = filter.GetDicomRTStruct();
- // s->Write(args_info.output_arg);
-
- // This is the end my friend
- return 0;
-}
-//--------------------------------------------------------------------
+++ /dev/null
-# file clitkImage2DicomRTStruct.ggo
-package "clitk"
-version "Convert (binary) image to DICOM RT Structure Set (contours)"
-
-option "config" - "Config file" string no
-option "verbose" v "Verbose" flag off
-
-option "input" i "Input image file (binary image" string yes
-option "output" o "Output DicomRT filename" string yes
-
-
-# option "image" j "Used to read image info (spacing, origin)" string yes
-# option "roi" r "ROI to binarize (if -1 = all roi)" int no default="-1"
-
-# option "crop" c "Crop binary mask" flag off
-
-#option "roi" r "ROI to print (ID)" int no
-#option "contour" c "contour to print (ID)" int no
-#option "offset" o "to display points as image offsets" flag off
-
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-===========================================================================**/
-
-// clitk
-#include "clitkIO.h"
-#include "clitkLabelImageOverlapMeasure_ggo.h"
-#include "clitkLabelImageOverlapMeasureGenericFilter.h"
-
-//--------------------------------------------------------------------
-int main(int argc, char * argv[]) {
-
- // Init command line
- GGO(clitkLabelImageOverlapMeasure, args_info);
- CLITK_INIT;
-
- // Filter
- typedef clitk::LabelImageOverlapMeasureGenericFilter<args_info_clitkLabelImageOverlapMeasure> FilterType;
- FilterType::Pointer filter = FilterType::New();
-
- filter->SetArgsInfo(args_info);
-
- try {
- filter->Update();
- } catch(std::runtime_error e) {
- std::cout << e.what() << std::endl;
- return EXIT_FAILURE;
- }
-
- return EXIT_SUCCESS;
-} // This is the end, my friend
-//--------------------------------------------------------------------
+++ /dev/null
-#File clitkLabelImageOverlapMeasure.ggo
-package "clitkLabelImageOverlapMeasure"
-version "1.0"
-purpose "Compute Dice and other coefficients between label images"
-
-section "General options"
-option "config" - "Config file" string no
-option "verbose" v "Verbose" flag off
-option "imagetypes" - "Display allowed image types" flag off
-
-section "Input"
-option "input1" i "Input mask 1" string yes
-option "input2" j "Input mask 2" string yes
-
-option "label1" l "Label in input1" int no default="1"
-option "label2" m "Label in input2" int no default="1"
-option "BG" b "Background value" int no default="0"
-
-
-
-
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-===========================================================================**/
-
-#ifndef CLITKLABELIMAGEOVERLAPMEASUREGENERICFILTER_H
-#define CLITKLABELIMAGEOVERLAPMEASUREGENERICFILTER_H
-
-// clitk
-#include "clitkImageToImageGenericFilter.h"
-#include "clitkLabelImageOverlapMeasureFilter.h"
-#include "clitkBoundingBoxUtils.h"
-#include "clitkCropLikeImageFilter.h"
-
-//--------------------------------------------------------------------
-namespace clitk
-{
-
- template<class ArgsInfoType>
- class ITK_EXPORT LabelImageOverlapMeasureGenericFilter:
- public ImageToImageGenericFilter<LabelImageOverlapMeasureGenericFilter<ArgsInfoType> >
- {
- public:
- //--------------------------------------------------------------------
- LabelImageOverlapMeasureGenericFilter();
-
- //--------------------------------------------------------------------
- typedef ImageToImageGenericFilter<LabelImageOverlapMeasureGenericFilter<ArgsInfoType> > Superclass;
- typedef LabelImageOverlapMeasureGenericFilter Self;
- typedef itk::SmartPointer<Self> Pointer;
- typedef itk::SmartPointer<const Self> ConstPointer;
-
- //--------------------------------------------------------------------
- itkNewMacro(Self);
- itkTypeMacro(LabelImageOverlapMeasureGenericFilter, LightObject);
-
- //--------------------------------------------------------------------
- void SetArgsInfo(const ArgsInfoType & a);
- template<class FilterType>
- void SetOptionsFromArgsInfoToFilter(FilterType * f) ;
-
- //--------------------------------------------------------------------
- // Main function called each time the filter is updated
- template<class ImageType>
- void UpdateWithInputImageType();
-
- protected:
- template<unsigned int Dim> void InitializeImageType();
- ArgsInfoType mArgsInfo;
-
- private:
- LabelImageOverlapMeasureGenericFilter(const Self&); //purposely not implemented
- void operator=(const Self&); //purposely not implemented
-
- };// end class
- //--------------------------------------------------------------------
-} // end namespace clitk
-
-#ifndef ITK_MANUAL_INSTANTIATION
-#include "clitkLabelImageOverlapMeasureGenericFilter.txx"
-#endif
-
-#endif // #define CLITKRELATIVEPOSITIONANALYZERGENERICFILTER_H
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
- ===========================================================================**/
-
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-clitk::LabelImageOverlapMeasureGenericFilter<ArgsInfoType>::
-LabelImageOverlapMeasureGenericFilter():
- ImageToImageGenericFilter<Self>("LabelImageOverlapMeasure")
-{
- // Default values
- cmdline_parser_clitkLabelImageOverlapMeasure_init(&mArgsInfo);
- //InitializeImageType<2>();
- InitializeImageType<3>();
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-template<unsigned int Dim>
-void clitk::LabelImageOverlapMeasureGenericFilter<ArgsInfoType>::
-InitializeImageType()
-{
- ADD_IMAGE_TYPE(Dim, uchar);
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-void clitk::LabelImageOverlapMeasureGenericFilter<ArgsInfoType>::
-SetArgsInfo(const ArgsInfoType & a)
-{
- mArgsInfo=a;
- SetIOVerbose(mArgsInfo.verbose_flag);
- if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes();
- if (mArgsInfo.input1_given) AddInputFilename(mArgsInfo.input1_arg);
- if (mArgsInfo.input2_given) AddInputFilename(mArgsInfo.input2_arg);
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-// Update with the number of dimensions and the pixeltype
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-template<class FilterType>
-void clitk::LabelImageOverlapMeasureGenericFilter<ArgsInfoType>::
-SetOptionsFromArgsInfoToFilter(FilterType * f)
-{
- f->SetLabel1(mArgsInfo.label1_arg);
- f->SetLabel2(mArgsInfo.label2_arg);
-}
-
-//--------------------------------------------------------------------
-// Update with the number of dimensions and the pixeltype
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-template<class ImageType>
-void clitk::LabelImageOverlapMeasureGenericFilter<ArgsInfoType>::
-UpdateWithInputImageType()
-{
- // Reading input
- typename ImageType::Pointer input1 = this->template GetInput<ImageType>(0);
- typename ImageType::Pointer input2 = this->template GetInput<ImageType>(1);
-
- // Create filter
- typedef clitk::LabelImageOverlapMeasureFilter<ImageType> FilterType;
- typename FilterType::Pointer filter = FilterType::New();
-
- // Set global Options
- filter->SetInput(0, input1);
- filter->SetInput(1, input2);
- SetOptionsFromArgsInfoToFilter<FilterType>(filter);
-
- // Go !
- filter->Update();
-
- // Write/Save results
- // typename ImageType::Pointer output = filter->GetOutput();
- // this->template SetNextOutput<ImageType>(output);
-}
-//--------------------------------------------------------------------
-
-
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-===========================================================================**/
-
-// clitk
-#include "clitkRelativePosition_ggo.h"
-#include "clitkRelativePositionGenericFilter.h"
-
-//--------------------------------------------------------------------
-int main(int argc, char * argv[]) {
-
- // Init command line
- GGO(clitkRelativePosition, args_info);
- CLITK_INIT;
-
- // Filter
- typedef clitk::RelativePositionGenericFilter<args_info_clitkRelativePosition> FilterType;
- FilterType::Pointer filter = FilterType::New();
-
- filter->SetArgsInfo(args_info);
-
- try {
- filter->Update();
- } catch(std::runtime_error e) {
- std::cout << e.what() << std::endl;
- }
-
- return EXIT_SUCCESS;
-} // This is the end, my friend
-//--------------------------------------------------------------------
+++ /dev/null
-#File clitkRelativePosition.ggo
-package "clitkRelativePosition"
-version "1.0"
-purpose "Constraint a given mask image relatively to another object and an orientation"
-
-section "General options"
-option "config" - "Config file" string no
-option "verbose" v "Verbose" flag off
-option "verboseStep" - "Verbose each step" flag off
-option "writeStep" w "Write image at each step" flag off
-option "verboseOptions" - "Display options values" flag off
-option "imagetypes" - "Display allowed image types" flag off
-
-section "Input/Output"
-option "input" i "Input mask image filename" string yes
-option "object" j "Input mask object filename" string yes
-option "output" o "Output image filename" string yes
-
-section "Main options"
-option "orientation" r "L R A P I S (LeftRightAntPostInfSup)" string no multiple default="L"
-option "angle1" a "Angle 1 (deg)" double no default="0"
-option "angle2" b "Angle 2 (deg)" double no default="0"
-option "spacing" s "Resample before (faster) (-1 if not resampling" double default = "-1" no
-option "threshold" t "Fuzzy threshold" double no default="0.6"
-option "inverse" n "Not flag : inverse of the orientation" flag off
-option "doNotRemoveObject" - "if flag is on, do not remove the object" flag off
-option "noAutoCrop" c "No auto crop at the end if set" flag off
-option "combineWithOr" - "Combine relpos map and support with OR" flag off
-
-section "Slice by slice processing"
-option "sliceBySlice" - "Slice by slice relative position" flag off
-option "direction" d "If SbS, indicate the slice direction" int no default="2"
-option "uniqueCCL" u "Keep only one CC in each slice" flag off
-option "uniqueObjectCCL" - "Keep only one CC in each object slice" flag off
-
-
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-===========================================================================**/
-
-// clitk
-#include "clitkRelativePositionAnalyzer_ggo.h"
-#include "clitkRelativePositionAnalyzerGenericFilter.h"
-
-//--------------------------------------------------------------------
-int main(int argc, char * argv[]) {
-
- // Init command line
- GGO(clitkRelativePositionAnalyzer, args_info);
- CLITK_INIT;
-
- // Filter
- typedef clitk::RelativePositionAnalyzerGenericFilter<args_info_clitkRelativePositionAnalyzer> FilterType;
- FilterType::Pointer filter = FilterType::New();
- filter->SetArgsInfo(args_info);
-
- // Go !
- try {
- filter->Update();
- } catch(std::runtime_error e) {
- std::cout << e.what() << std::endl;
- return EXIT_FAILURE;
- }
-
- return EXIT_SUCCESS;
-} // This is the end, my friend
-//--------------------------------------------------------------------
+++ /dev/null
-#File clitkRelativePositionAnalyzer.ggo
-package "clitkRelativePositionAnalyzer"
-version "1.0"
-purpose "Analyze relative position of a target according to structures"
-
-section "General options"
-option "config" - "Config file" string no
-option "verbose" v "Verbose" flag off
-option "imagetypes" - "Display allowed image types" flag off
-
-section "Input/Output"
-option "support" i "Input mask support" string yes
-option "object" j "Input mask object" string yes
-option "target" t "Input mask target" string yes
-option "output" o "Output image " string yes
-
-section "Options for building the relative positions"
-option "bins" - "Number of histo bins for fuzzy map" int default="100" no
-option "tol" - "Target area loss tolerance (|0-1])" double default="0.01" no
-
-option "angle1" a "Angle 1 (deg)" double no default="0"
-option "angle2" b "Angle 2 (deg)" double no default="0"
-option "inverse" n "Not flag : inverse of the orientation" flag off
-
-
-section "Compute some statistic on afdb"
-option "afdb" - "Input Anatomical Feature DB" string no multiple
-option "afdb_path" - "Path to search image in afdb" string no multiple
-option "station" - "Station name" string no
-
-
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-===========================================================================**/
-
-#ifndef CLITKRELATIVEPOSITIONANALYZERGENERICFILTER_H
-#define CLITKRELATIVEPOSITIONANALYZERGENERICFILTER_H
-
-// clitk
-#include "clitkIO.h"
-#include "clitkImageToImageGenericFilter.h"
-#include "clitkRelativePositionAnalyzerFilter.h"
-#include "clitkSliceBySliceRelativePositionFilter.h"
-
-//--------------------------------------------------------------------
-namespace clitk
-{
-
- template<class ArgsInfoType>
- class ITK_EXPORT RelativePositionAnalyzerGenericFilter:
- public ImageToImageGenericFilter<RelativePositionAnalyzerGenericFilter<ArgsInfoType> >
- {
- public:
- //--------------------------------------------------------------------
- RelativePositionAnalyzerGenericFilter();
- ~RelativePositionAnalyzerGenericFilter() {}
-
- //--------------------------------------------------------------------
- typedef ImageToImageGenericFilter<RelativePositionAnalyzerGenericFilter<ArgsInfoType> > Superclass;
- typedef RelativePositionAnalyzerGenericFilter Self;
- typedef itk::SmartPointer<Self> Pointer;
- typedef itk::SmartPointer<const Self> ConstPointer;
-
- //--------------------------------------------------------------------
- itkNewMacro(Self);
- itkTypeMacro(RelativePositionAnalyzerGenericFilter, LightObject);
-
- //--------------------------------------------------------------------
- void SetArgsInfo(const ArgsInfoType & a);
- template<class FilterType>
- void SetOptionsFromArgsInfoToFilter(FilterType * f) ;
-
- //--------------------------------------------------------------------
- // Main function called each time the filter is updated
- template<class ImageType>
- void UpdateWithInputImageType();
-
- protected:
- template<unsigned int Dim> void InitializeImageType();
- ArgsInfoType mArgsInfo;
-
- private:
- RelativePositionAnalyzerGenericFilter(const Self&); //purposely not implemented
- void operator=(const Self&); //purposely not implemented
-
- };// end class
- //--------------------------------------------------------------------
-} // end namespace clitk
-
-#ifndef ITK_MANUAL_INSTANTIATION
-#include "clitkRelativePositionAnalyzerGenericFilter.txx"
-#endif
-
-#endif // #define CLITKRELATIVEPOSITIONANALYZERGENERICFILTER_H
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
- ===========================================================================**/
-
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-clitk::RelativePositionAnalyzerGenericFilter<ArgsInfoType>::
-RelativePositionAnalyzerGenericFilter():
- ImageToImageGenericFilter<Self>("RelativePositionAnalyzer")
-{
- // Default values
- cmdline_parser_clitkRelativePositionAnalyzer_init(&mArgsInfo);
- InitializeImageType<3>();
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-template<unsigned int Dim>
-void clitk::RelativePositionAnalyzerGenericFilter<ArgsInfoType>::
-InitializeImageType()
-{
- ADD_IMAGE_TYPE(Dim, uchar);
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-void clitk::RelativePositionAnalyzerGenericFilter<ArgsInfoType>::
-SetArgsInfo(const ArgsInfoType & a)
-{
- mArgsInfo=a;
- SetIOVerbose(mArgsInfo.verbose_flag);
- if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes();
- if (mArgsInfo.support_given) AddInputFilename(mArgsInfo.support_arg);
- if (mArgsInfo.object_given) AddInputFilename(mArgsInfo.object_arg);
- if (mArgsInfo.target_given) AddInputFilename(mArgsInfo.target_arg);
- if (mArgsInfo.output_given) AddOutputFilename(mArgsInfo.output_arg);
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-// Update with the number of dimensions and the pixeltype
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-template<class FilterType>
-void clitk::RelativePositionAnalyzerGenericFilter<ArgsInfoType>::
-SetOptionsFromArgsInfoToFilter(FilterType * f)
-{
- f->SetNumberOfBins(mArgsInfo.bins_arg);
- f->SetAreaLossTolerance(mArgsInfo.tol_arg);
- clitk::RelativePositionDirectionType d;
- if (mArgsInfo.angle1_given) d.angle1 = clitk::deg2rad(mArgsInfo.angle1_arg);
- if (mArgsInfo.angle2_given) d.angle2 = clitk::deg2rad(mArgsInfo.angle2_arg);
- if (mArgsInfo.inverse_given) d.notFlag = clitk::deg2rad(mArgsInfo.inverse_flag);
- f->SetDirection(d);
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-// Update with the number of dimensions and the pixeltype
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-template<class ImageType>
-void clitk::RelativePositionAnalyzerGenericFilter<ArgsInfoType>::
-UpdateWithInputImageType()
-{
- // Create filter
- typedef clitk::RelativePositionAnalyzerFilter<ImageType> FilterType;
- typename FilterType::Pointer filter = FilterType::New();
-
- // Reading input
- typename ImageType::Pointer support = this->template GetInput<ImageType>(0);
- typename ImageType::Pointer object = this->template GetInput<ImageType>(1);
- typename ImageType::Pointer target = this->template GetInput<ImageType>(2);
- filter->SetInputSupport(support);
- filter->SetInputObject(object);
- filter->SetInputTarget(target);
-
- // Set global Options
- SetOptionsFromArgsInfoToFilter<FilterType>(filter);
-
- // Go !
- filter->Update();
-
- // Display output
- filter->GetInfo().Println();
- filter->GetInfoReverse().Println();
-}
-//--------------------------------------------------------------------
-
-
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-===========================================================================**/
-
-// clitk
-#include "clitkRelativePositionDataBaseAnalyzer_ggo.h"
-#include "clitkIO.h"
-#include "clitkRelativePositionDataBaseAnalyzerFilter.h"
-
-//--------------------------------------------------------------------
-int main(int argc, char * argv[]) {
-
- // Init command line
- GGO(clitkRelativePositionDataBaseAnalyzer, args_info);
- CLITK_INIT;
-
- // Filter
- typedef clitk::RelativePositionDataBaseAnalyzerFilter FilterType;
- FilterType filter;
- filter.SetDatabaseFilename(args_info.db_arg);
- filter.SetStationName(args_info.station_arg);
- // filter.SetStationName(args_info.object_arg);//FIXME
- filter.SetOutputFilename(args_info.output_arg);
-
- try {
- filter.Update();
- } catch(std::runtime_error e) {
- std::cout << e.what() << std::endl;
- return EXIT_FAILURE;
- }
-
- return EXIT_SUCCESS;
-} // This is the end, my friend
-//--------------------------------------------------------------------
+++ /dev/null
-#File clitkRelativePositionDataBaseAnalyzer.ggo
-package "clitkRelativePositionDataBaseAnalyzer"
-version "1.0"
-purpose "Analyze a DB of relative positions for several patient and structures"
-
-section "General options"
-option "config" - "Config file" string no
-option "verbose" v "Verbose" flag off
-
-section "Input/Output"
-option "db" i "Input database of RelPost" string yes
-option "station" s "Studied station name" string yes
-option "object" - "Studied object/struct name" string no
-option "output" o "Output rpl file" string yes
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-===========================================================================**/
-
-// clitk
-#include "clitkRelativePositionDataBaseBuilder_ggo.h"
-#include "clitkRelativePositionDataBaseBuilderGenericFilter.h"
-
-//--------------------------------------------------------------------
-int main(int argc, char * argv[]) {
-
- // Init command line
- GGO(clitkRelativePositionDataBaseBuilder, args_info);
- CLITK_INIT;
-
- // Filter
- typedef clitk::RelativePositionDataBaseBuilderGenericFilter<args_info_clitkRelativePositionDataBaseBuilder> FilterType;
- FilterType::Pointer filter = FilterType::New();
-
- // Set options
- filter->SetArgsInfo(args_info);
-
- // Add an input to determine the type of image
- NewAFDB(afdb, args_info.afdb_arg);
- std::string f = afdb->GetTagValue(args_info.supportName_arg);
- f = std::string(args_info.afdb_path_arg)+"/"+f;
- filter->AddInputFilename(f);
-
- try {
- filter->Update();
- } catch(std::runtime_error e) {
- std::cout << e.what() << std::endl;
- return EXIT_FAILURE;
- }
-
- return EXIT_SUCCESS;
-} // This is the end, my friend
-//--------------------------------------------------------------------
+++ /dev/null
-#File clitkRelativePositionDataBaseBuilder.ggo
-package "clitkRelativePositionDataBaseBuilder"
-version "1.0"
-purpose "Analyze relative position of a target according to structures"
-
-section "General options"
-option "config" - "Config file" string no
-option "verbose" v "Verbose" flag off
-option "imagetypes" - "Display allowed image types" flag off
-
-section "Input/Output"
-option "afdb" a "Input Anatomical Feature DB" string yes
-option "afdb_path" - "Path to search image in afdb" string no
-
-option "supportName" i "Input mask support name in afdb" string yes
-option "targetName" t "Input mask target name in afdb" string yes
-option "objectName" j "Input mask object name in afdb" string yes multiple
-
-option "output" o "Output image " string yes
-
-section "Options for building the relative positions"
-option "bins" b "Number of histo bins for fuzzy map" int default="100" no
-option "nb" n "Number of angles to test" int default="4" no
-option "tol" - "Target area loss tolerance (|0-1])" double default="0.01" no
-
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-===========================================================================**/
-
-#ifndef CLITKRelativePositionDataBaseBuilderGENERICFILTER_H
-#define CLITKRelativePositionDataBaseBuilderGENERICFILTER_H
-
-// clitk
-#include "clitkIO.h"
-#include "clitkImageToImageGenericFilter.h"
-#include "clitkRelativePositionDataBaseBuilderFilter.h"
-#include "clitkSliceBySliceRelativePositionFilter.h"
-
-//--------------------------------------------------------------------
-namespace clitk
-{
-
- template<class ArgsInfoType>
- class ITK_EXPORT RelativePositionDataBaseBuilderGenericFilter:
- public ImageToImageGenericFilter<RelativePositionDataBaseBuilderGenericFilter<ArgsInfoType> >
- {
- public:
- //--------------------------------------------------------------------
- RelativePositionDataBaseBuilderGenericFilter();
-
- //--------------------------------------------------------------------
- typedef ImageToImageGenericFilter<RelativePositionDataBaseBuilderGenericFilter<ArgsInfoType> > Superclass;
- typedef RelativePositionDataBaseBuilderGenericFilter Self;
- typedef itk::SmartPointer<Self> Pointer;
- typedef itk::SmartPointer<const Self> ConstPointer;
-
- //--------------------------------------------------------------------
- itkNewMacro(Self);
- itkTypeMacro(RelativePositionDataBaseBuilderGenericFilter, LightObject);
-
- //--------------------------------------------------------------------
- void SetArgsInfo(const ArgsInfoType & a);
- template<class FilterType>
- void SetOptionsFromArgsInfoToFilter(FilterType * f) ;
-
- //--------------------------------------------------------------------
- // Main function called each time the filter is updated
- template<class ImageType>
- void UpdateWithInputImageType();
-
- protected:
- template<unsigned int Dim> void InitializeImageType();
- ArgsInfoType mArgsInfo;
-
- private:
- RelativePositionDataBaseBuilderGenericFilter(const Self&); //purposely not implemented
- void operator=(const Self&); //purposely not implemented
-
- };// end class
- //--------------------------------------------------------------------
-} // end namespace clitk
-
-#ifndef ITK_MANUAL_INSTANTIATION
-#include "clitkRelativePositionDataBaseBuilderGenericFilter.txx"
-#endif
-
-#endif // #define CLITKRelativePositionDataBaseBuilderGENERICFILTER_H
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
- ===========================================================================**/
-
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-clitk::RelativePositionDataBaseBuilderGenericFilter<ArgsInfoType>::
-RelativePositionDataBaseBuilderGenericFilter():
- ImageToImageGenericFilter<Self>("RelativePositionDataBaseBuilder")
-{
- // Default values
- cmdline_parser_clitkRelativePositionDataBaseBuilder_init(&mArgsInfo);
- InitializeImageType<3>();
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-template<unsigned int Dim>
-void clitk::RelativePositionDataBaseBuilderGenericFilter<ArgsInfoType>::
-InitializeImageType()
-{
- ADD_IMAGE_TYPE(Dim, uchar);
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-void clitk::RelativePositionDataBaseBuilderGenericFilter<ArgsInfoType>::
-SetArgsInfo(const ArgsInfoType & a)
-{
- mArgsInfo=a;
- SetIOVerbose(mArgsInfo.verbose_flag);
- if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes();
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-// Update with the number of dimensions and the pixeltype
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-template<class FilterType>
-void clitk::RelativePositionDataBaseBuilderGenericFilter<ArgsInfoType>::
-SetOptionsFromArgsInfoToFilter(FilterType * f)
-{
- f->SetAFDBFilename(mArgsInfo.afdb_arg);
- f->SetAFDBPath(mArgsInfo.afdb_path_arg);
- f->SetNumberOfBins(mArgsInfo.bins_arg);
- f->SetNumberOfAngles(mArgsInfo.nb_arg);
- f->SetAreaLossTolerance(mArgsInfo.tol_arg);
- f->SetSupportName(mArgsInfo.supportName_arg);
- f->SetTargetName(mArgsInfo.targetName_arg);
- for(unsigned int i=0; i<mArgsInfo.objectName_given; i++)
- f->AddObjectName(mArgsInfo.objectName_arg[i]);
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-// Update with the number of dimensions and the pixeltype
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-template<class ImageType>
-void clitk::RelativePositionDataBaseBuilderGenericFilter<ArgsInfoType>::
-UpdateWithInputImageType()
-{
- // Create filter
- typedef clitk::RelativePositionDataBaseBuilderFilter<ImageType> FilterType;
- typename FilterType::Pointer filter = FilterType::New();
-
- // Set global Options
- SetOptionsFromArgsInfoToFilter<FilterType>(filter);
-
- // Go !
- filter->Update();
-
- // Write/Save results
- // typename ImageType::Pointer output = filter->GetOutput();
- //this->template SetNextOutput<ImageType>(output);
-
-}
-//--------------------------------------------------------------------
-
-
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-===========================================================================**/
-
-#ifndef CLITKRELATIVEPOSITIONGENERICFILTER_H
-#define CLITKRELATIVEPOSITIONGENERICFILTER_H
-
-// clitk
-#include "clitkIO.h"
-#include "clitkImageToImageGenericFilter.h"
-#include "clitkAddRelativePositionConstraintToLabelImageFilter.h"
-#include "clitkSliceBySliceRelativePositionFilter.h"
-
-//--------------------------------------------------------------------
-namespace clitk
-{
-
- template<class ArgsInfoType>
- class ITK_EXPORT RelativePositionGenericFilter:
- public ImageToImageGenericFilter<RelativePositionGenericFilter<ArgsInfoType> >
- {
- public:
- //--------------------------------------------------------------------
- RelativePositionGenericFilter();
-
- //--------------------------------------------------------------------
- typedef ImageToImageGenericFilter<RelativePositionGenericFilter<ArgsInfoType> > Superclass;
- typedef RelativePositionGenericFilter Self;
- typedef itk::SmartPointer<Self> Pointer;
- typedef itk::SmartPointer<const Self> ConstPointer;
-
- //--------------------------------------------------------------------
- itkNewMacro(Self);
- itkTypeMacro(RelativePositionGenericFilter, LightObject);
-
- //--------------------------------------------------------------------
- void SetArgsInfo(const ArgsInfoType & a);
- template<class FilterType>
- void SetOptionsFromArgsInfoToFilter(FilterType * f) ;
-
- //--------------------------------------------------------------------
- // Main function called each time the filter is updated
- template<class ImageType>
- void UpdateWithInputImageType();
-
- protected:
- template<unsigned int Dim> void InitializeImageType();
- ArgsInfoType mArgsInfo;
-
- private:
- RelativePositionGenericFilter(const Self&); //purposely not implemented
- void operator=(const Self&); //purposely not implemented
-
- };// end class
- //--------------------------------------------------------------------
-} // end namespace clitk
-
-#ifndef ITK_MANUAL_INSTANTIATION
-#include "clitkRelativePositionGenericFilter.txx"
-#endif
-
-#endif // #define CLITKRELATIVEPOSITIONGENERICFILTER_H
+++ /dev/null
-/*=========================================================================
- Program: vv http://www.creatis.insa-lyon.fr/rio/vv
-
- Authors belong to:
- - University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://www.centreleonberard.fr
- - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
-
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the copyright notices for more information.
-
- It is distributed under dual licence
-
- - BSD See included LICENSE.txt file
- - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
- ===========================================================================**/
-
-#include "clitkImageCommon.h"
-
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-clitk::RelativePositionGenericFilter<ArgsInfoType>::
-RelativePositionGenericFilter():
- ImageToImageGenericFilter<Self>("RelativePosition")
-{
- // Default values
- cmdline_parser_clitkRelativePosition_init(&mArgsInfo);
- InitializeImageType<3>();
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-template<unsigned int Dim>
-void clitk::RelativePositionGenericFilter<ArgsInfoType>::
-InitializeImageType()
-{
- ADD_IMAGE_TYPE(Dim, uchar);
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-void clitk::RelativePositionGenericFilter<ArgsInfoType>::
-SetArgsInfo(const ArgsInfoType & a)
-{
- mArgsInfo=a;
- SetIOVerbose(mArgsInfo.verbose_flag);
- if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes();
- if (mArgsInfo.input_given) AddInputFilename(mArgsInfo.input_arg);
- if (mArgsInfo.object_given) AddInputFilename(mArgsInfo.object_arg);
- if (mArgsInfo.output_given) AddOutputFilename(mArgsInfo.output_arg);
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-// Update with the number of dimensions and the pixeltype
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-template<class FilterType>
-void clitk::RelativePositionGenericFilter<ArgsInfoType>::
-SetOptionsFromArgsInfoToFilter(FilterType * f)
-{
- f->SetVerboseOptionFlag(mArgsInfo.verboseOptions_flag);
- f->SetVerboseStepFlag(mArgsInfo.verboseStep_flag);
- f->SetWriteStepFlag(mArgsInfo.writeStep_flag);
-
- // Must be set before AddOrientationTypeString
- f->SetInverseOrientationFlag(mArgsInfo.inverse_flag);
-
- for(uint i=0; i<mArgsInfo.orientation_given; i++) {
- f->AddOrientationTypeString(mArgsInfo.orientation_arg[i]);
- }
-
- if (mArgsInfo.spacing_given) {
- f->IntermediateSpacingFlagOn();
- f->SetIntermediateSpacing(mArgsInfo.spacing_arg);
- }
- else {
- f->IntermediateSpacingFlagOff();
- }
-
- f->SetFuzzyThreshold(mArgsInfo.threshold_arg);
- f->SetRemoveObjectFlag(!mArgsInfo.doNotRemoveObject_flag);
- f->SetAutoCropFlag(!mArgsInfo.noAutoCrop_flag);
- f->SetCombineWithOrFlag(mArgsInfo.combineWithOr_flag);
-}
-
-//--------------------------------------------------------------------
-// Update with the number of dimensions and the pixeltype
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-template<class ImageType>
-void clitk::RelativePositionGenericFilter<ArgsInfoType>::
-UpdateWithInputImageType()
-{
- // Reading input
- typename ImageType::Pointer input = this->template GetInput<ImageType>(0);
- typename ImageType::Pointer object = this->template GetInput<ImageType>(1);
-
- if (mArgsInfo.sliceBySlice_flag) {
- // Create filter
- typedef clitk::SliceBySliceRelativePositionFilter<ImageType> FilterType;
- typename FilterType::Pointer filter = FilterType::New();
-
- // Set the filter (needed for example for threaded monitoring)
- this->SetFilterBase(filter);
-
- // Set global Options
- filter->SetInput(input);
- filter->SetInputObject(object);
- SetOptionsFromArgsInfoToFilter<FilterType>(filter);
-
- // Set options only for SliceBySliceRelativePositionFilter
- filter->SetDirection(mArgsInfo.direction_arg);
- filter->SetUniqueConnectedComponentBySliceFlag(mArgsInfo.uniqueCCL_flag);
- if (mArgsInfo.uniqueObjectCCL_flag) {
- filter->UseTheLargestObjectCCLFlagOn();
- }
- else {
- filter->UseTheLargestObjectCCLFlagOff();
- }
-
- // Go !
- filter->Update();
-
- // Write/Save results
- typename ImageType::Pointer output = filter->GetOutput();
- this->template SetNextOutput<ImageType>(output);
- }
- else {
- // Create filter
- typedef clitk::AddRelativePositionConstraintToLabelImageFilter<ImageType> FilterType;
- typename FilterType::Pointer filter = FilterType::New();
-
- // Set the filter (needed for example for threaded monitoring)
- this->SetFilterBase(filter);
-
- // Set global Options
- filter->SetInput(input);
- filter->SetInputObject(object);
- if (mArgsInfo.angle1_given && mArgsInfo.angle2_given)
- filter->AddAnglesInDeg(mArgsInfo.angle1_arg, mArgsInfo.angle2_arg);
- SetOptionsFromArgsInfoToFilter<FilterType>(filter);
-
- // Go !
- filter->Update();
-
- // Write/Save results
- typename ImageType::Pointer output = filter->GetOutput();
- this->template SetNextOutput<ImageType>(output);
- }
-}
-//--------------------------------------------------------------------
-
-