+ Add ggo.c files in each library used in vv and clitk.
+ Patch CropImageFilter in vv and clitk to remove ArgsInfoType template.
#=========================================================
-#Add your ggo files to this list if they are used by vv
-FOREACH(clitkTool clitkAffineRegistration)
- WRAP_GGO(${clitkTool}_GGO_C ${clitkTool}.ggo)
- SET(GGO_C_FILES ${GGO_C_FILES} ${${clitkTool}_GGO_C})
-ENDFOREACH(clitkTool)
-ADD_LIBRARY(clitkRegistrationGgoLib ${GGO_C_FILES})
-SET_SOURCE_FILES_PROPERTIES(clitkGenericAffineTransform.cxx PROPERTIES
- OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/clitkAffineRegistration_ggo.h)
-ADD_LIBRARY(clitkAffineRegistrationLib clitkAffineRegistrationGenericFilter.cxx clitkLBFGSBOptimizer.cxx clitkGenericAffineTransform.cxx)
+# Add Libraries used in vv and clitk to avoid recompilation
+WRAP_GGO(clitkAffineRegistration_GGO_C clitkAffineRegistration.ggo)
+ADD_LIBRARY(clitkAffineRegistrationLib
+ clitkAffineRegistrationGenericFilter.cxx
+ ${clitkAffineRegistration_GGO_C}
+ clitkLBFGSBOptimizer.cxx
+ clitkGenericAffineTransform.cxx)
#=========================================================
IF(CLITK_BUILD_REGISTRATION)
############################## registration algorithms
ADD_EXECUTABLE(clitkAffineRegistration clitkAffineRegistration.cxx)
- TARGET_LINK_LIBRARIES(clitkAffineRegistration clitkAffineRegistrationLib clitkRegistrationGgoLib clitkCommon ITKIO ITKNumerics ITKStatistics)
+ TARGET_LINK_LIBRARIES(clitkAffineRegistration clitkAffineRegistrationLib clitkCommon ITKIO ITKNumerics ITKStatistics)
WRAP_GGO(clitkDemonsDeformableRegistration_GGO_C clitkDemonsDeformableRegistration.ggo)
ADD_EXECUTABLE(clitkDemonsDeformableRegistration clitkDemonsDeformableRegistration.cxx ${clitkDemonsDeformableRegistration_GGO_C} clitkDemonsDeformableRegistrationGenericFilter.cxx)
#=========================================================
-#Add your ggo files to this list if they are used by vv
+# Add Libraries used in vv and clitk to avoid recompilation
FOREACH(clitkTool clitkExtractLung clitkExtractPatient)
WRAP_GGO(${clitkTool}_GGO_C ${clitkTool}.ggo)
SET(GGO_C_FILES ${GGO_C_FILES} ${${clitkTool}_GGO_C})
ENDFOREACH(clitkTool)
-ADD_LIBRARY(clitkSegmentationGgoLib clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx clitkAnatomicalFeatureDatabase.cxx ${GGO_C_FILES})
+ADD_LIBRARY(clitkSegmentationGgoLib
+ clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx
+ clitkAnatomicalFeatureDatabase.cxx
+ ${GGO_C_FILES})
#=========================================================
#=========================================================
INCLUDE(${PROJECT_SOURCE_DIR}/cmake/common.cmake)
#=========================================================
-#Add your ggo files to this list if they are used by vv
-FOREACH(clitkTool clitkAffineTransform clitkBinarizeImage clitkImageArithm
- clitkMedianImageFilter clitkImageConvert clitkCropImage clitkResampleImage clitkMIP)
- WRAP_GGO(${clitkTool}_GGO_C ${clitkTool}.ggo)
- SET(GGO_C_FILES ${GGO_C_FILES} ${${clitkTool}_GGO_C})
-ENDFOREACH(clitkTool)
-ADD_LIBRARY(clitkToolsGgoLib ${GGO_C_FILES})
-#=========================================================
-#the libraries avoid recompilation for vv, and should be used for generic filters
-#with long compilation times that are used by vv
-ADD_LIBRARY(clitkImageConvertLib clitkImageConvertGenericFilter.cxx)
-ADD_LIBRARY(clitkBinarizeImageLib clitkBinarizeImageGenericFilter.cxx)
-ADD_LIBRARY(clitkImageArithmImageLib clitkImageArithmGenericFilter.cxx)
-ADD_LIBRARY(clitkResampleImageLib clitkResampleImageGenericFilter.cxx)
-SET_SOURCE_FILES_PROPERTIES(clitkResampleImageGenericFilter.cxx PROPERTIES
- OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/clitkResampleImage_ggo.h)
-ADD_LIBRARY(clitkMIPLib clitkMIPGenericFilter.cxx)
-
-TARGET_LINK_LIBRARIES(clitkBinarizeImageLib clitkToolsGgoLib)
+# Add Libraries used in vv and clitk to avoid recompilation
+WRAP_GGO(clitkCropImage_GGO_C clitkCropImage.ggo)
+ADD_LIBRARY(clitkCropImageLib clitkCropImageGenericFilter.cxx ${clitkCropImage_GGO_C})
+
+WRAP_GGO(clitkImageConvert_GGO_C clitkImageConvert.ggo)
+ADD_LIBRARY(clitkImageConvertLib clitkImageConvertGenericFilter.cxx ${clitkImageConvert_GGO_C})
+
+WRAP_GGO(clitkBinarizeImage_GGO_C clitkBinarizeImage.ggo)
+ADD_LIBRARY(clitkBinarizeImageLib clitkBinarizeImageGenericFilter.cxx ${clitkBinarizeImage_GGO_C})
+
+WRAP_GGO(clitkImageArithm_GGO_C clitkImageArithm.ggo)
+ADD_LIBRARY(clitkImageArithmImageLib clitkImageArithmGenericFilter.cxx ${clitkImageArithm_GGO_C})
+
+WRAP_GGO(clitkResampleImage_GGO_C clitkResampleImage.ggo)
+ADD_LIBRARY(clitkResampleImageLib clitkResampleImageGenericFilter.cxx ${clitkResampleImage_GGO_C})
+
+WRAP_GGO(clitkMIP_GGO_C clitkMIP.ggo)
+ADD_LIBRARY(clitkMIPLib clitkMIPGenericFilter.cxx ${clitkMIP_GGO_C})
IF (CLITK_BUILD_TOOLS)
WRAP_GGO(clitkDicomInfo_GGO_C clitkDicomInfo.ggo)
ADD_EXECUTABLE(clitkImageInfo clitkImageInfo.cxx ${clitkImageInfo_GGO_C})
TARGET_LINK_LIBRARIES(clitkImageInfo clitkCommon ITKIO)
- ADD_EXECUTABLE(clitkImageConvert clitkImageConvert.cxx ${clitkImageConvert_GGO_C})
+ ADD_EXECUTABLE(clitkImageConvert clitkImageConvert.cxx)
TARGET_LINK_LIBRARIES(clitkImageConvert clitkImageConvertLib clitkCommon ITKIO)
- ADD_EXECUTABLE(clitkBinarizeImage clitkBinarizeImage.cxx
- ${clitkBinarizeImage_GGO_C})
+ ADD_EXECUTABLE(clitkBinarizeImage clitkBinarizeImage.cxx)
TARGET_LINK_LIBRARIES(clitkBinarizeImage clitkBinarizeImageLib clitkCommon ITKIO)
WRAP_GGO(clitkVFResample_GGO_C clitkVFResample.ggo)
ADD_EXECUTABLE(clitkInvertVF clitkInvertVF.cxx ${clitkInvertVF_GGO_C})
TARGET_LINK_LIBRARIES(clitkInvertVF clitkCommon ITKIO )
+ WRAP_GGO(clitkAffineTransform_GGO_C clitkAffineTransform.ggo)
ADD_EXECUTABLE(clitkAffineTransform clitkAffineTransform.cxx ${clitkAffineTransform_GGO_C})
TARGET_LINK_LIBRARIES(clitkAffineTransform clitkCommon ITKIO )
ADD_EXECUTABLE(clitkGammaIndex clitkGammaIndex.cxx ${clitkGammaIndex_GGO_C})
TARGET_LINK_LIBRARIES(clitkGammaIndex vtkCommon vtkFiltering vtkGraphics vtkIO vtkImaging)
- ADD_EXECUTABLE(clitkImageArithm clitkImageArithm.cxx ${clitkImageArithm_GGO_C})
+ ADD_EXECUTABLE(clitkImageArithm clitkImageArithm.cxx)
TARGET_LINK_LIBRARIES(clitkImageArithm clitkImageArithmImageLib clitkCommon ITKIO )
WRAP_GGO(clitkUnsharpMask_GGO_C clitkUnsharpMask.ggo)
ADD_EXECUTABLE(clitkFooImage clitkFooImage.cxx ${clitkFooImage_GGO_C})
TARGET_LINK_LIBRARIES(clitkFooImage clitkCommon ITKIO )
+ WRAP_GGO(clitkMedianImageFilter_GGO_C clitkMedianImageFilter.ggo)
ADD_EXECUTABLE(clitkMedianImageFilter clitkMedianImageFilter.cxx ${clitkMedianImageFilter_GGO_C})
TARGET_LINK_LIBRARIES(clitkMedianImageFilter clitkCommon ITKIO ITKBasicFilters )
- #WRAP_GGO(clitkResampleImage_GGO_C clitkResampleImage.ggo)
- ADD_EXECUTABLE(clitkResampleImage clitkResampleImage.cxx ${clitkResampleImage_GGO_C})
+ ADD_EXECUTABLE(clitkResampleImage clitkResampleImage.cxx)
TARGET_LINK_LIBRARIES(clitkResampleImage clitkResampleImageLib clitkCommon ITKIO)
WRAP_GGO(clitkMinMaxMask_GGO_C clitkMinMaxMask.ggo)
TARGET_LINK_LIBRARIES(clitkBackProjectImage ITKIO clitkCommon )
ADD_EXECUTABLE(clitkCropImage clitkCropImage.cxx ${clitkCropImage_GGO_C})
- TARGET_LINK_LIBRARIES(clitkCropImage clitkCommon ITKIO)
+ TARGET_LINK_LIBRARIES(clitkCropImage clitkCropImageLib clitkCommon ITKIO)
# WRAP_GGO(clitkExtractSlice_GGO_C clitkExtractSlice.ggo)
# ADD_EXECUTABLE(clitkExtractSlice clitkExtractSlice.cxx clitkExtractSliceGenericFilter.cxx ${clitkExtractSlice_GGO_C})
ADD_EXECUTABLE(clitkValuesToBSplineCoefficients clitkValuesToBSplineCoefficients.cxx clitkValuesToBSplineCoefficientsGenericFilter.cxx ${clitkValuesToBSplineCoefficients_GGO_C})
TARGET_LINK_LIBRARIES(clitkValuesToBSplineCoefficients clitkCommon ITKIO)
- ADD_EXECUTABLE(clitkMIP clitkMIP.cxx clitkMIPGenericFilter.cxx ${clitkMIP_GGO_C})
- TARGET_LINK_LIBRARIES(clitkMIP clitkCommon ITKIO)
+ ADD_EXECUTABLE(clitkMIP clitkMIP.cxx clitkMIPGenericFilter.cxx)
+ TARGET_LINK_LIBRARIES(clitkMIP clitkMIPLib clitkCommon ITKIO)
WRAP_GGO(clitkRelativePosition_GGO_C clitkRelativePosition.ggo)
ADD_EXECUTABLE(clitkRelativePosition clitkRelativePosition.cxx ${clitkRelativePosition_GGO_C})
======================================================================-====*/
// clitk
-#include "clitkCropImage_ggo.h"
#include "clitkCropImageGenericFilter.h"
//--------------------------------------------------------------------
CLITK_INIT;
// Filter
- typedef clitk::CropImageGenericFilter<args_info_clitkCropImage> FilterType;
+ typedef clitk::CropImageGenericFilter FilterType;
FilterType::Pointer filter = FilterType::New();
filter->SetArgsInfo(args_info);
//-----------------------------------------------------------
// Constructor
//-----------------------------------------------------------
- CropImageGenericFilter::CropImageGenericFilter()
+ CropImageGenericFilter::CropImageGenericFilter():
+ ImageToImageGenericFilter<Self>("CropImage")
{
- m_Verbose=false;
- m_InputFileName="";
+ cmdline_parser_clitkCropImage_init(&mArgsInfo);
+ InitializeImageType<2>();
+ InitializeImageType<3>();
+ InitializeImageType<4>();
}
-
- //-----------------------------------------------------------
- // Update
- //-----------------------------------------------------------
- void CropImageGenericFilter::Update()
+ //--------------------------------------------------------------------
+ template<unsigned int Dim>
+ void clitk::CropImageGenericFilter::InitializeImageType()
{
- // Read the Dimension and PixelType
- int Dimension, Components;
- std::string PixelType;
- ReadImageDimensionAndPixelType(m_InputFileName, Dimension, PixelType, Components);
+ ADD_DEFAULT_IMAGE_TYPES(Dim);
+ //ADD_IMAGE_TYPE(Dim, uchar);
+ //ADD_IMAGE_TYPE(Dim, short);
+ // ADD_IMAGE_TYPE(Dim, uint);
+ // ADD_IMAGE_TYPE(Dim, ulong);
+ // ADD_IMAGE_TYPE(Dim, int);
+ // ADD_IMAGE_TYPE(Dim, float);
+ }
+ //--------------------------------------------------------------------
+ //--------------------------------------------------------------------
+ void clitk::CropImageGenericFilter::SetArgsInfo(const args_info_type& a)
+ {
+ mArgsInfo=a;
+ SetIOVerbose(mArgsInfo.verbose_flag);
+ if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes();
+ if (mArgsInfo.input_given) AddInputFilename(mArgsInfo.input_arg);
+ if (mArgsInfo.output_given) AddOutputFilename(mArgsInfo.output_arg);
+ }
+ //--------------------------------------------------------------------
+
+ //--------------------------------------------------------------------
+ // Update with the number of dimensions and the pixeltype
+ //--------------------------------------------------------------------
+ template<class ImageType>
+ void clitk::CropImageGenericFilter::UpdateWithInputImageType()
+ {
+ // Reading input
+ typename ImageType::Pointer input = this->template GetInput<ImageType>(0);
+
+ // Check options
+ if (mArgsInfo.BG_given && mArgsInfo.like_given)
+ clitkExceptionMacro("Do not use --BG and --like at the same time");
+
+ // Prepare output
+ typename ImageType::Pointer output;
- // Call UpdateWithDim
- if(Dimension==2) UpdateWithDim<2>(PixelType, Components);
- else if(Dimension==3) UpdateWithDim<3>(PixelType, Components);
- else if (Dimension==4)UpdateWithDim<4>(PixelType, Components);
- else
- {
- std::cout<<"Error, Only for 2, 3 or 4 Dimensions!!!"<<std::endl ;
- return;
+ // ------------------------------------------------
+ if (mArgsInfo.BG_given) { // AutoCrop filter
+ if (mArgsInfo.boundingBox_given)
+ clitkExceptionMacro("Do not use --BG and --boundingBox at the same time");
+ if (mArgsInfo.lower_given)
+ clitkExceptionMacro("Do not use --BG and --lower at the same time");
+ if (mArgsInfo.upper_given)
+ clitkExceptionMacro("Do not use --BG and --upper at the same time");
+ typedef clitk::AutoCropFilter<ImageType> FilterType;
+ typename FilterType::Pointer filter = FilterType::New();
+ filter->SetInput(input);
+ filter->SetBackgroundValue(mArgsInfo.BG_arg);
+ filter->Update();
+ output = filter->GetOutput();
+ }
+ else {
+ // ------------------------------------------------
+ if (mArgsInfo.like_given) { // CropLike filter
+ if (mArgsInfo.boundingBox_given)
+ clitkExceptionMacro("Do not use --like and --boundingBox at the same time");
+ if (mArgsInfo.lower_given)
+ clitkExceptionMacro("Do not use --like and --lower at the same time");
+ if (mArgsInfo.upper_given)
+ clitkExceptionMacro("Do not use --like and --upper at the same time");
+ typedef clitk::CropLikeImageFilter<ImageType> FilterType;
+ typename FilterType::Pointer filter = FilterType::New();
+ filter->SetInput(input);
+ filter->SetCropLikeFilename(mArgsInfo.like_arg);
+ filter->SetBackgroundValue(mArgsInfo.BGLike_arg);
+ filter->Update();
+ output = filter->GetOutput();
}
- }
+ else {
+ // ------------------------------------------------
+ typename ImageType::SizeType lSize;
+ typename ImageType::SizeType uSize;
+ if (mArgsInfo.boundingBox_given) {
+ for(unsigned int i=0; i<ImageType::ImageDimension; i++) {
+ lSize[i] = mArgsInfo.boundingBox_arg[2*i];
+ uSize[i] = input->GetLargestPossibleRegion().GetSize()[i]-mArgsInfo.boundingBox_arg[2*i+1]-1;
+ }
+ }
+ else {
+ if (mArgsInfo.lower_given) {
+ for(unsigned int i=0; i<ImageType::ImageDimension; i++)
+ lSize[i]=static_cast<unsigned int >(mArgsInfo.lower_arg[i]);
+ }
+ else lSize.Fill(0);
+ if (mArgsInfo.upper_given) {
+ for(unsigned int i=0; i<ImageType::ImageDimension; i++)
+ uSize[i]=static_cast<unsigned int >(mArgsInfo.upper_arg[i]);
+ }
+ else uSize.Fill(0);
+ }
+ typedef itk::CropImageFilter<ImageType, ImageType> CropImageFilterType;
+ typename CropImageFilterType::Pointer filter=CropImageFilterType::New();
+ filter->SetInput(input);
+ filter->SetLowerBoundaryCropSize(lSize);
+ filter->SetUpperBoundaryCropSize(uSize);
+ filter->Update();
+ output = filter->GetOutput();
+ }
+ }
+ // Force origin if needed
+ if (mArgsInfo.origin_flag) {
+ typename ImageType::PointType origin;
+ origin.Fill(itk::NumericTraits<double>::Zero);
+ output->SetOrigin(origin);
+ }
+
+ // Write/Save results
+ this->template SetNextOutput<ImageType>(output);
+ }
+ //--------------------------------------------------------------------
} //end clitk
/*=========================================================================
Program: vv http://www.creatis.insa-lyon.fr/rio/vv
- Authors belong to:
+ Authors belong to:
- University of LYON http://www.universite-lyon.fr/
- Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
- CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
#ifndef CLITKCROPIMAGEGENERICFILTER_H
#define CLITKCROPIMAGEGENERICFILTER_H
-// clitk
+// clitk
#include "clitkIO.h"
#include "clitkImageToImageGenericFilter.h"
#include "clitkCropLikeImageFilter.h"
#include "clitkAutoCropFilter.h"
+#include "clitkCropImage_ggo.h"
// itk
#include <itkCropImageFilter.h>
//--------------------------------------------------------------------
-namespace clitk
+namespace clitk
{
- template<class ArgsInfoType>
class ITK_EXPORT CropImageGenericFilter:
- public ImageToImageGenericFilter<CropImageGenericFilter<ArgsInfoType> >
+ public ImageToImageGenericFilter<CropImageGenericFilter>
{
public:
//--------------------------------------------------------------------
CropImageGenericFilter();
-
+
//--------------------------------------------------------------------
typedef CropImageGenericFilter Self;
- typedef ImageToImageGenericFilter<CropImageGenericFilter<ArgsInfoType> > Superclass;
+ typedef ImageToImageGenericFilter<CropImageGenericFilter> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
-
+ typedef args_info_clitkCropImage args_info_type;
+
//--------------------------------------------------------------------
- itkNewMacro(Self);
+ itkNewMacro(Self);
itkTypeMacro( CropImageGenericFilter, LightObject );
//--------------------------------------------------------------------
- void SetArgsInfo(const ArgsInfoType & a);
+ void SetArgsInfo(const args_info_type& a);
//--------------------------------------------------------------------
// Main function called each time the filter is updated
- template<class ImageType>
+ template<class ImageType>
void UpdateWithInputImageType();
protected:
template<unsigned int Dim> void InitializeImageType();
- ArgsInfoType mArgsInfo;
+ args_info_type mArgsInfo;
};// end class
//--------------------------------------------------------------------
+++ /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://oncora1.lyon.fnclcc.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::CropImageGenericFilter<ArgsInfoType>::CropImageGenericFilter():
- ImageToImageGenericFilter<Self>("CropImage")
-{
- // Default values
- cmdline_parser_clitkCropImage_init(&mArgsInfo);
- InitializeImageType<2>();
- InitializeImageType<3>();
- InitializeImageType<4>();
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-template<unsigned int Dim>
-void clitk::CropImageGenericFilter<ArgsInfoType>::InitializeImageType()
-{
- ADD_DEFAULT_IMAGE_TYPES(Dim);
- //ADD_IMAGE_TYPE(Dim, uchar);
- //ADD_IMAGE_TYPE(Dim, short);
- // ADD_IMAGE_TYPE(Dim, uint);
- // ADD_IMAGE_TYPE(Dim, ulong);
- // ADD_IMAGE_TYPE(Dim, int);
- // ADD_IMAGE_TYPE(Dim, float);
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-void clitk::CropImageGenericFilter<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.output_given) AddOutputFilename(mArgsInfo.output_arg);
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-// Update with the number of dimensions and the pixeltype
-//--------------------------------------------------------------------
-template<class ArgsInfoType>
-template<class ImageType>
-void clitk::CropImageGenericFilter<ArgsInfoType>::UpdateWithInputImageType()
-{
- // Reading input
- typename ImageType::Pointer input = this->template GetInput<ImageType>(0);
-
- // Check options
- if (mArgsInfo.BG_given && mArgsInfo.like_given)
- clitkExceptionMacro("Do not use --BG and --like at the same time");
-
- // Prepare output
- typename ImageType::Pointer output;
-
- // ------------------------------------------------
- if (mArgsInfo.BG_given) { // AutoCrop filter
- if (mArgsInfo.boundingBox_given)
- clitkExceptionMacro("Do not use --BG and --boundingBox at the same time");
- if (mArgsInfo.lower_given)
- clitkExceptionMacro("Do not use --BG and --lower at the same time");
- if (mArgsInfo.upper_given)
- clitkExceptionMacro("Do not use --BG and --upper at the same time");
- typedef clitk::AutoCropFilter<ImageType> FilterType;
- typename FilterType::Pointer filter = FilterType::New();
- filter->SetInput(input);
- filter->SetBackgroundValue(mArgsInfo.BG_arg);
- filter->Update();
- output = filter->GetOutput();
- }
- else {
- // ------------------------------------------------
- if (mArgsInfo.like_given) { // CropLike filter
- if (mArgsInfo.boundingBox_given)
- clitkExceptionMacro("Do not use --like and --boundingBox at the same time");
- if (mArgsInfo.lower_given)
- clitkExceptionMacro("Do not use --like and --lower at the same time");
- if (mArgsInfo.upper_given)
- clitkExceptionMacro("Do not use --like and --upper at the same time");
- typedef clitk::CropLikeImageFilter<ImageType> FilterType;
- typename FilterType::Pointer filter = FilterType::New();
- filter->SetInput(input);
- filter->SetCropLikeFilename(mArgsInfo.like_arg);
- filter->SetBackgroundValue(mArgsInfo.BGLike_arg);
- filter->Update();
- output = filter->GetOutput();
- }
- else {
- // ------------------------------------------------
- typename ImageType::SizeType lSize;
- typename ImageType::SizeType uSize;
- if (mArgsInfo.boundingBox_given) {
- for(unsigned int i=0; i<ImageType::ImageDimension; i++) {
- lSize[i] = mArgsInfo.boundingBox_arg[2*i];
- uSize[i] = input->GetLargestPossibleRegion().GetSize()[i]-mArgsInfo.boundingBox_arg[2*i+1]-1;
- }
- }
- else {
- if (mArgsInfo.lower_given) {
- for(unsigned int i=0; i<ImageType::ImageDimension; i++)
- lSize[i]=static_cast<unsigned int >(mArgsInfo.lower_arg[i]);
- }
- else lSize.Fill(0);
- if (mArgsInfo.upper_given) {
- for(unsigned int i=0; i<ImageType::ImageDimension; i++)
- uSize[i]=static_cast<unsigned int >(mArgsInfo.upper_arg[i]);
- }
- else uSize.Fill(0);
- }
- typedef itk::CropImageFilter<ImageType, ImageType> CropImageFilterType;
- typename CropImageFilterType::Pointer filter=CropImageFilterType::New();
- filter->SetInput(input);
- filter->SetLowerBoundaryCropSize(lSize);
- filter->SetUpperBoundaryCropSize(uSize);
- filter->Update();
- output = filter->GetOutput();
- }
- }
-
- // Force origin if needed
- if (mArgsInfo.origin_flag) {
- typename ImageType::PointType origin;
- origin.Fill(itk::NumericTraits<double>::Zero);
- output->SetOrigin(origin);
- }
-
- // Write/Save results
- this->template SetNextOutput<ImageType>(output);
-}
-//--------------------------------------------------------------------
-
-
vvToolBinarize
vvToolImageArithm
vvToolResample
-# vvToolExtractPatient
+# vvToolExtractPatient
# vvToolExtractLung
vvToolMIP
vvToolConvert ## with dummy vvToolConvert.ui
# dependencies of the tools
# Future issues : when tool depend on other tools ... how to manage that ?
# >> add the relevant $_LIBS variable to the tool that has dependencies?
-SET(vvToolRigidReg_LIBS clitkAffineRegistrationLib clitkRegistrationGgoLib)
+SET(vvToolRigidReg_LIBS clitkAffineRegistrationLib)
SET(vvToolBinarize_LIBS clitkBinarizeImageLib)
SET(vvToolResample_LIBS clitkResampleImageLib)
SET(vvToolConvert_LIBS clitkImageConvertLib)
SET(vvToolExtractPatient_LIBS clitkSegmentationGgoLib)
SET(vvToolExtractLung_LIBS clitkSegmentationGgoLib)
-SET(vvToolCropImage_LIBS clitkToolsGgoLib)
-SET(vvToolMIP_LIBS clitkMIPLib clitkToolsGgoLib)
+SET(vvToolCropImage_LIBS clitkCropImageLib)
+SET(vvToolMIP_LIBS clitkMIPLib)
#=========================================================
# List of vv source files
LINK_DIRECTORIES(${QT_LIBRARY_DIR})
ADD_EXECUTABLE(vv ${vv_SRCS} vv.cxx ${vv_UI_CXX} ${EXE_ICON})
-ADD_DEPENDENCIES(vv clitkToolsGgoLib clitkSegmentationGgoLib)
+ADD_DEPENDENCIES(vv clitkSegmentationGgoLib)
TARGET_LINK_LIBRARIES(vv clitkDicomRTStruct)
#=========================================================
// Typedef
typedef args_info_clitkCropImage ArgsInfoType;
- typedef clitk::CropImageGenericFilter<ArgsInfoType> CropFilterType;
+ typedef clitk::CropImageGenericFilter CropFilterType;
// Get options
ArgsInfoType mArgsInfo;