WRAP_GGO(clitkVectorArithm_GGO_C clitkVectorArithm.ggo)
add_library(clitkVectorArithmLib clitkVectorArithmGenericFilter.cxx ${clitkVectorArithm_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})
target_link_libraries(clitkMedianImageFilter clitkMedianImageFilterLib clitkCommon)
set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkMedianImageFilter)
- add_executable(clitkResampleImage clitkResampleImage.cxx)
- target_link_libraries(clitkResampleImage clitkResampleImageLib clitkCommon)
- set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkResampleImage)
-
WRAP_GGO(clitkMinMaxMask_GGO_C clitkMinMaxMask.ggo)
add_executable(clitkMinMaxMask clitkMinMaxMask.cxx ${clitkMinMaxMask_GGO_C})
target_link_libraries(clitkMinMaxMask clitkCommon )
+++ /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 "clitkResampleImage_ggo.h"
-#include "clitkIO.h"
-#include "clitkResampleImageGenericFilter.h"
-
-//--------------------------------------------------------------------
-int main(int argc, char * argv[])
-{
-
- // Init command line
- GGO(clitkResampleImage, args_info);
- CLITK_INIT;
-
- // Filter
- typedef clitk::ResampleImageGenericFilter FilterType;
- FilterType::Pointer filter = FilterType::New();
-
- filter->SetArgsInfo(args_info);
- CLITK_TRY_CATCH_EXIT(filter->Update());
-
- // this is the end my friend
- return EXIT_SUCCESS;
-
-}// end main
-//--------------------------------------------------------------------
+++ /dev/null
-#File clitkImageResample.ggo
-package "clitkResampleImage"
-version "2.0"
-purpose "Resample an image. You can specify the interpolation, you can apply a Gaussian filter before (automated if downsample)."
-
-section "Common"
-option "config" - "Config file" string no
-option "verbose" v "Verbose" flag off
-option "imagetypes" - "Verbose: allowed image types" flag off
-option "thread" - "Nb of thread to use (default=max)" int no
-
-section "Input & Output options"
-option "input" i "Input image filename" string yes
-option "output" o "Output image filename" string yes
-option "like" l "Resample like this image" string no
-option "size" - "Number of pixels of each coordonate" int no multiple default="0"
-option "spacing" - "Spacing in mm between pixels" float no multiple default="-1.0"
-option "default" d "Default pixel value" float no default = "0.0"
-option "time" t "Last Dimension Is Time -> do not resample it (auto on for 4D)" flag off
-
-section "Interpolation"
-option "interp" - "Interpolation type: {nn, linear, bspline, blut}" string no default="nn"
-option "order" b "BSpline ordre (range 0-5)" int no default="3"
-option "sampling" s "BLUT sampling value" int no default="30"
-
-section "Gaussian filtering"
-option "gauss" g "Apply Gaussian before (sigma in mm)" float no multiple default="0.0"
-option "autogauss" a "Apply Gaussian with auto sigma when downsample" 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 "clitkResampleImageGenericFilter.h"
-#include "clitkResampleImageWithOptionsFilter.h"
-
-//--------------------------------------------------------------------
-clitk::ResampleImageGenericFilter::ResampleImageGenericFilter():
- ImageToImageGenericFilter<Self>("Resample")
-{
- InitializeImageType<2>();
- InitializeImageType<3>();
- InitializeImageType<4>();
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template<unsigned int Dim>
-void clitk::ResampleImageGenericFilter::InitializeImageType()
-{
- ADD_DEFAULT_IMAGE_TYPES(Dim);
- ADD_IMAGE_TYPE(Dim, short);
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-void clitk::ResampleImageGenericFilter::SetArgsInfo(const ArgsInfoType & a)
-{
- mArgsInfo=a;
- if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes();
- SetIOVerbose(mArgsInfo.verbose_flag);
- if (mArgsInfo.input_given) {
- SetInputFilename(mArgsInfo.input_arg);
- }
- if (mArgsInfo.output_given) {
- SetOutputFilename(mArgsInfo.output_arg);
- }
-}
-//--------------------------------------------------------------------
-
+++ /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 CLITKIRESAMPLEIMAGEGENERICFILTER_H
-#define CLITKIRESAMPLEIMAGEGENERICFILTER_H
-
-// clitk include
-#include "clitkResampleImage_ggo.h"
-#include "clitkImageToImageGenericFilter.h"
-
-namespace clitk {
-
- //--------------------------------------------------------------------
- class ITK_EXPORT ResampleImageGenericFilter:
- public ImageToImageGenericFilter<ResampleImageGenericFilter> {
-
- public:
- // Constructor
- ResampleImageGenericFilter();
-
- // Types
- typedef ResampleImageGenericFilter Self;
- typedef itk::SmartPointer<Self> Pointer;
- typedef itk::SmartPointer<const Self> ConstPointer;
- typedef args_info_clitkResampleImage ArgsInfoType;
-
- // New
- itkNewMacro(Self);
-
- // Args
- void SetArgsInfo(const ArgsInfoType & a);
-
- // Main function
- template<class InputImageType> void UpdateWithInputImageType();
-
- protected:
- ArgsInfoType mArgsInfo;
- template<unsigned int Dim> void InitializeImageType();
-
- }; // end class ResampleImageGenericFilter
- //--------------------------------------------------------------------
-
-} // end namespace clitk
-//--------------------------------------------------------------------
-
-#ifndef ITK_MANUAL_INSTANTIATION
-#include "clitkResampleImageGenericFilter.txx"
-#endif
-
-#endif /* end #define CLITKIRESAMPLEIMAGEGENERICFILTER_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
- ===========================================================================**/
-
-#ifndef CLITKRESAMPLEIMAGEGENERICFILTER_TXX
-#define CLITKRESAMPLEIMAGEGENERICFILTER_TXX
-
-// clitk
-#include "clitkResampleImageWithOptionsFilter.h"
-
-//--------------------------------------------------------------------
-// Update with the number of dimensions and the pixeltype
-//--------------------------------------------------------------------
-template<class InputImageType>
-void
-clitk::ResampleImageGenericFilter::UpdateWithInputImageType()
-{
-
- // Reading input
- typename InputImageType::Pointer input = this->template GetInput<InputImageType>(0);
-
- // Main filter
- typedef typename InputImageType::PixelType PixelType;
- typedef InputImageType OutputImageType; // to change to float is user ask it (?)
-
- // Filter
- typedef clitk::ResampleImageWithOptionsFilter<InputImageType, OutputImageType> ResampleImageFilterType;
- typename ResampleImageFilterType::Pointer filter = ResampleImageFilterType::New();
- filter->SetInput(input);
-
- // Set Verbose
- filter->SetVerboseOptions(mArgsInfo.verbose_flag);
-
- // Set size / spacing
- static const unsigned int dim = OutputImageType::ImageDimension;
- typename OutputImageType::SpacingType spacing;
- typename OutputImageType::SizeType size;
- typename OutputImageType::PointType origin;
- typename OutputImageType::DirectionType direction;
-
- if (mArgsInfo.like_given) {
- itk::ImageIOBase::Pointer header = clitk::readImageHeader(mArgsInfo.like_arg);
- if (header) {
- for(unsigned int i=0; i<dim; i++){
- spacing[i] = header->GetSpacing(i);
- size[i] = header->GetDimensions(i);
- origin[i] = header->GetOrigin(i);
- }
- for(unsigned int i=0; i<dim; i++) {
- for(unsigned int j=0;j<dim;j++) {
- direction(i,j) = header->GetDirection(i)[j];
- }
- }
- filter->SetOutputSpacing(spacing);
- filter->SetOutputSize(size);
- filter->SetOutputOrigin(origin);
- filter->SetOutputDirection(direction);
- }
- else {
- std::cerr << "*** Warning : I could not read '" << mArgsInfo.like_arg << "' ***" << std::endl;
- exit(0);
- }
- }
- else {
- if (mArgsInfo.spacing_given == 1) {
- filter->SetOutputIsoSpacing(mArgsInfo.spacing_arg[0]);
- }
- else if ((mArgsInfo.spacing_given != 0) && (mArgsInfo.size_given != 0)) {
- std::cerr << "Error: use spacing or size, not both." << std::endl;
- exit(0);
- }
- else if (mArgsInfo.spacing_given) {
- if ((mArgsInfo.spacing_given != 0) && (mArgsInfo.spacing_given != dim)) {
- std::cerr << "Error: spacing should have one or " << dim << " values." << std::endl;
- exit(0);
- }
- for(unsigned int i=0; i<dim; i++)
- spacing[i] = mArgsInfo.spacing_arg[i];
- filter->SetOutputSpacing(spacing);
- }
- else if (mArgsInfo.size_given) {
- if ((mArgsInfo.size_given != 0) && (mArgsInfo.size_given != dim)) {
- std::cerr << "Error: size should have " << dim << " values." << std::endl;
- exit(0);
- }
- for(unsigned int i=0; i<dim; i++)
- size[i] = mArgsInfo.size_arg[i];
- filter->SetOutputSize(size);
- }
- for(unsigned int i=0; i<dim; i++){
- origin[i] = input->GetOrigin()[i];
- }
- for(unsigned int i=0; i<dim; i++) {
- for(unsigned int j=0;j<dim;j++) {
- direction(i,j) = input->GetDirection()[i][j];
- }
- }
- filter->SetOutputOrigin(origin);
- filter->SetOutputDirection(direction);
- }
-
- // Set temporal dimension
- filter->SetLastDimensionIsTime(mArgsInfo.time_flag);
-
- // Set Gauss
- filter->SetGaussianFilteringEnabled(mArgsInfo.autogauss_flag);
- if (mArgsInfo.gauss_given != 0) {
- typename ResampleImageFilterType::GaussianSigmaType g;
- for(unsigned int i=0; i<dim; i++) {
- g[i] = mArgsInfo.gauss_arg[i];
- }
- filter->SetGaussianSigma(g);
- }
-
- // Set Interpolation
- std::string interp = std::string(mArgsInfo.interp_arg);
- if (interp == "nn") {
- filter->SetInterpolationType(ResampleImageFilterType::NearestNeighbor);
- } else {
- if (interp == "linear") {
- filter->SetInterpolationType(ResampleImageFilterType::Linear);
- } else {
- if (interp == "bspline") {
- filter->SetInterpolationType(ResampleImageFilterType::BSpline);
- } else {
- if (interp == "blut") {
- filter->SetInterpolationType(ResampleImageFilterType::B_LUT);
- } else {
- if (interp == "windowed sinc") {
- filter->SetInterpolationType(ResampleImageFilterType::WSINC);
- } else {
- std::cerr << "Error. I do not know interpolation '" << mArgsInfo.interp_arg
- << "'. Choose among: nn, linear, bspline, blut, windowed sinc" << std::endl;
- exit(0);
- }
- }
- }
- }
- }
-
- // Set default pixel value
- filter->SetDefaultPixelValue(mArgsInfo.default_arg);
-
- // Set thread
- if (mArgsInfo.thread_given) {
- filter->SetNumberOfThreads(mArgsInfo.thread_arg);
- }
-
- // Go !
- filter->Update();
- typename OutputImageType::Pointer outputImage = filter->GetOutput();
- this->template SetNextOutput<OutputImageType>(outputImage);
-}
-//--------------------------------------------------------------------
-
-#endif /* end #define CLITKRESAMPLEIMAGEGENERICFILTER_TXX */
-
vvToolCropImage
vvToolBinarize
vvToolImageArithm
- vvToolResample
vvToolMIP
vvToolConvert ## with dummy vvToolConvert.ui
vvToolROIManager
set(vvToolBinarize_LIBS clitkBinarizeImageLib)
set(vvToolProfile_LIBS clitkProfileImageLib)
set(vvToolHistogram_LIBS clitkHistogramImageLib)
-set(vvToolResample_LIBS clitkResampleImageLib)
set(vvToolConvert_LIBS clitkImageConvertLib)
set(vvToolExtractPatient_LIBS clitkSegmentationGgoLib)
set(vvToolExtractLung_LIBS clitkSegmentationGgoLib)