return true;
}
//--------------------------------------------------------------------
-
+
+ //--------------------------------------------------------------------
+ std::ostream& operator<<(std::ostream & os, const clitk::RelativePositionInformationType & rp)
+ {
+ rp.Print(os);
+ return os;
+ }
+ //--------------------------------------------------------------------
} // end namespace clitk
//--------------------------------------------------------------------
os << std::endl;
}
};
+ std::ostream& operator<<(std::ostream & os, const clitk::RelativePositionInformationType & rp);
//--------------------------------------------------------------------
/** Set the input image. This must be set by the user. */
virtual void SetInputImage(const TImageType * inputData);
+ /** Evaluate the function at a ContinuousIndex position.
+ Overwritten for taking LUT into account (RP: multi-threading-compatible version,
+ the threadID is actually ignored) */
+ virtual OutputType EvaluateAtContinuousIndex(const ContinuousIndexType & index, unsigned int /* threadID */ ) const
+ {
+ return this->EvaluateAtContinuousIndex( index );
+ }
+
/** Evaluate the function at a ContinuousIndex position.
Overwritten for taking LUT into account */
virtual OutputType EvaluateAtContinuousIndex(const ContinuousIndexType & index ) const;
SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkLabelImageOverlapMeasure)
WRAP_GGO(clitkRelativePositionAnalyzer_GGO_C clitkRelativePositionAnalyzer.ggo)
- ADD_EXECUTABLE(clitkRelativePositionAnalyzer clitkRelativePositionAnalyzer.cxx ${clitkRelativePositionAnalyzer_GGO_C})
+ ADD_EXECUTABLE(clitkRelativePositionAnalyzer ../itk/clitkRelativePositionDataBase.cxx clitkRelativePositionAnalyzer.cxx ${clitkRelativePositionAnalyzer_GGO_C})
TARGET_LINK_LIBRARIES(clitkRelativePositionAnalyzer clitkSegmentationGgoLib clitkCommon ${ITK_LIBRARIES})
SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkRelativePositionAnalyzer)
SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkRelativePositionDataBaseAnalyzer)
WRAP_GGO(clitkRelativePositionDataBaseBuilder_GGO_C clitkRelativePositionDataBaseBuilder.ggo)
- ADD_EXECUTABLE(clitkRelativePositionDataBaseBuilder clitkRelativePositionDataBaseBuilder.cxx ${clitkRelativePositionDataBaseBuilder_GGO_C})
+ ADD_EXECUTABLE(clitkRelativePositionDataBaseBuilder ../itk/clitkRelativePositionDataBase.cxx clitkRelativePositionDataBaseBuilder.cxx ${clitkRelativePositionDataBaseBuilder_GGO_C})
TARGET_LINK_LIBRARIES(clitkRelativePositionDataBaseBuilder clitkSegmentationGgoLib clitkCommon ${ITK_LIBRARIES})
SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkRelativePositionDataBaseBuilder)
TARGET_LINK_LIBRARIES(clitkPadImage clitkCommon ${ITK_LIBRARIES})
SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkPadImage)
+ WRAP_GGO(clitkCatImage_GGO_C clitkCatImage.ggo)
+ ADD_EXECUTABLE(clitkCatImage clitkCatImage.cxx ${clitkCatImage_GGO_C})
+ TARGET_LINK_LIBRARIES(clitkCatImage clitkCommon ${ITK_LIBRARIES})
+ SET(TOOLS_INSTALL ${TOOLS_INSTALL} clitkCatImage)
+
IF(CLITK_EXPERIMENTAL)
WRAP_GGO(clitkBinaryImageToMesh_GGO_C clitkBinaryImageToMesh.ggo)
--- /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 "clitkCatImage_ggo.h"
+#include "clitkCatImageGenericFilter.h"
+
+//--------------------------------------------------------------------
+int main(int argc, char * argv[])
+{
+
+ // Init command line
+ GGO(clitkCatImage, args_info);
+ CLITK_INIT;
+
+ // Filter
+ typedef clitk::CatImageGenericFilter<args_info_clitkCatImage> FilterType;
+ FilterType::Pointer filter = FilterType::New();
+
+ filter->SetArgsInfo(args_info);
+ CLITK_TRY_CATCH_EXIT(filter->Update());
+
+
+ return EXIT_SUCCESS;
+}// end main
+
+//--------------------------------------------------------------------
--- /dev/null
+#File clitkCatImage.ggo
+package "clitkCatImage"
+version "1.0"
+purpose "Concatenate two images along chosen direction"
+
+option "config" - "Config file" string optional
+option "verbose" v "Verbose" flag off
+
+option "imagetypes" - "Display allowed image types" flag off
+
+option "input1" i "First input image filename" string required
+option "input2" j "Second input image filename" string required
+option "output" o "Output image filename" string required
+option "dimension" d "Dimension on which to concatenate" int required
--- /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 CLITKCatImageGENERICFILTER_H
+#define CLITKCatImageGENERICFILTER_H
+#include "clitkIO.h"
+#include "clitkImageToImageGenericFilter.h"
+
+//--------------------------------------------------------------------
+namespace clitk
+{
+
+template<class args_info_type>
+class ITK_EXPORT CatImageGenericFilter:
+ public ImageToImageGenericFilter<CatImageGenericFilter<args_info_type> >
+{
+
+public:
+
+ //--------------------------------------------------------------------
+ CatImageGenericFilter();
+
+ //--------------------------------------------------------------------
+ typedef CatImageGenericFilter Self;
+ typedef itk::SmartPointer<Self> Pointer;
+ typedef itk::SmartPointer<const Self> ConstPointer;
+
+ //--------------------------------------------------------------------
+ // Method for creation through the object factory
+ // and Run-time type information (and related methods)
+ itkNewMacro(Self);
+ itkTypeMacro(CatImageGenericFilter, LightObject);
+
+ //--------------------------------------------------------------------
+ void SetArgsInfo(const args_info_type & a);
+
+ //--------------------------------------------------------------------
+ // Main function called each time the filter is updated
+ template<class InputImageType>
+ void UpdateWithInputImageType();
+
+protected:
+ template<unsigned int Dim> void InitializeImageType();
+ args_info_type mArgsInfo;
+
+}; // end class
+//--------------------------------------------------------------------
+
+} // end namespace clitk
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include "clitkCatImageGenericFilter.txx"
+#endif
+
+#endif // #define clitkCatImageGenericFilter_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 clitkCatImageGenericFilter_txx
+#define clitkCatImageGenericFilter_txx
+
+#include <itkConstantPadImageFilter.h>
+#include <itkPasteImageFilter.h>
+#include <clitkCommon.h>
+
+namespace clitk
+{
+
+//--------------------------------------------------------------------
+template<class args_info_type>
+CatImageGenericFilter<args_info_type>::CatImageGenericFilter():
+ ImageToImageGenericFilter<Self>("CatImage")
+{
+ InitializeImageType<2>();
+ InitializeImageType<3>();
+ InitializeImageType<4>();
+}
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+template<class args_info_type>
+template<unsigned int Dim>
+void CatImageGenericFilter<args_info_type>::InitializeImageType()
+{
+ ADD_DEFAULT_IMAGE_TYPES(Dim);
+ ADD_VEC_IMAGE_TYPE(2,2,float);
+ ADD_VEC_IMAGE_TYPE(2,3,float);
+ ADD_VEC_IMAGE_TYPE(3,3,float);
+}
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+template<class args_info_type>
+void CatImageGenericFilter<args_info_type>::SetArgsInfo(const args_info_type & 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);
+ if (mArgsInfo.output_given)
+ SetOutputFilename(mArgsInfo.output_arg);
+}
+//--------------------------------------------------------------------
+
+//--------------------------------------------------------------------
+// Update with the number of dimensions and the pixeltype
+//--------------------------------------------------------------------
+template<class args_info_type>
+template<class InputImageType>
+void
+CatImageGenericFilter<args_info_type>::UpdateWithInputImageType()
+{
+
+ // Reading input 1
+ typename InputImageType::Pointer input1 = this->template GetInput<InputImageType>(0);
+ typename InputImageType::Pointer input2 = this->template GetInput<InputImageType>(1);
+
+ // Main filter
+ typedef typename InputImageType::PixelType PixelType;
+ typedef itk::Image<char, InputImageType::ImageDimension> OutputImageType;
+
+ typename InputImageType::RegionType region;
+ region = input2->GetLargestPossibleRegion();
+
+ // Filter
+ typename InputImageType::SizeType upperBound;
+ upperBound.Fill(0);
+ upperBound[mArgsInfo.dimension_arg] = region.GetSize()[mArgsInfo.dimension_arg];
+ typedef itk::ConstantPadImageFilter<InputImageType, InputImageType> PadImageFilterType;
+ typename PadImageFilterType::Pointer pad= PadImageFilterType::New();
+ pad->SetInput(input1);
+ pad->SetPadUpperBound(upperBound);
+
+ typename InputImageType::IndexType index;
+ index.Fill(0);
+ index[mArgsInfo.dimension_arg] = input1->GetLargestPossibleRegion().GetSize(mArgsInfo.dimension_arg);
+
+ typedef itk::PasteImageFilter<InputImageType, InputImageType, InputImageType> PasteImageFilterType;
+ typename PasteImageFilterType::Pointer pasteFilter=PasteImageFilterType::New();
+ pasteFilter->SetSourceImage(input2);
+ pasteFilter->SetDestinationImage(pad->GetOutput());
+ pasteFilter->SetDestinationIndex(index);
+ pasteFilter->SetSourceRegion(region);
+ pasteFilter->InPlaceOn();
+ pasteFilter->Update();
+
+ typename InputImageType::Pointer output = pasteFilter->GetOutput();
+
+ this->template SetNextOutput<InputImageType>(output);
+}
+//--------------------------------------------------------------------
+
+
+}//end clitk
+
+#endif //#define clitkCatImageGenericFilter_txx
// load reference
vtkImageData* reference = loadImage(reference_filename);
assert(reference);
+
+ // translate target with arguments values
+ // reference is translated instead of target so that the output space stay the same as target
+ {
+ double reference_origin[3];
+ reference->GetOrigin(reference_origin);
+ reference_origin[0] -= args_info.translation_x_arg;
+ reference_origin[1] -= args_info.translation_y_arg;
+ reference_origin[2] -= args_info.translation_z_arg;
+ reference->SetOrigin(reference_origin);
+ }
// intensity normalisation
if (!use_dose_margin) {
vtkImageData* target = loadImage(target_filename);
assert(target);
+
// allocate output
OutputImageType::Pointer output = OutputImageType::New();
{
option "spatial-margin" s "Spatial margin [mm]" double yes
option "relative-dose-margin" r "Dose margin relative to max dose in reference [%]" double no
option "absolute-dose-margin" d "Absolute dose margin [Gray]" double no
+option "translation-x" x "Target relative position x [mm]" double default="0" no
+option "translation-y" y "Target relative position y [mm]" double default="0" no
+option "translation-z" z "Target relative position z [mm]" double default="0" no