clitkBinarizeImage_ggo.c
clitkMedianImageGenericFilter.cxx
clitkMedianImageFilter_ggo.c
+ clitkUnsharpMask_ggo.c
clitkFooImage_ggo.c
-
-
)
ADD_LIBRARY(clitkFilters STATIC ${clitkFilters_SRC})
version "1.0"
purpose ""
-option "config" - "Config file" string no
+option "config" - "Config file" string optional
option "verbose" v "Verbose" flag off
option "imagetypes" - "Display allowed image types" flag off
-option "input" i "Input image filename" string yes
-option "output" o "Output image filename" string yes
-option "lower" l "Lower intensity (default=min), fg is greater than this value" double no
-option "upper" u "Upper intensity (default=max), fg is lower than this value" double no
-
-option "fg" - "Foreground (FG) or 'inside' value" double no default="1"
- option "bg" - "Background (BG) or 'ouside' value" double no default="0"
- option "mode" - "Use FG and/or BG values (if FG, the BG is replaced by the input image values)" values="FG","BG","both" default="both" no
+option "input" i "Input image filename" string required
+option "output" o "Output image filename" string required
+option "lower" l "Lower intensity (default=min), fg is greater than this value" double optional
+option "upper" u "Upper intensity (default=max), fg is lower than this value" double optional
+option "fg" - "Foreground (FG) or 'inside' value" double optional default="1"
+option "bg" - "Background (BG) or 'ouside' value" double optional default="0"
+option "mode" - "Use FG and/or BG values (if FG, the BG is replaced by the input image values)" values="FG","BG","both" default="both" optional
ADD_IMAGE_TYPE(Dim, short);
ADD_IMAGE_TYPE(Dim, ushort);
ADD_IMAGE_TYPE(Dim, int);
- ADD_IMAGE_TYPE(Dim, uint16);
ADD_IMAGE_TYPE(Dim, float);
ADD_IMAGE_TYPE(Dim, double);
}
--- /dev/null
+#File clitkUnsharpMask.ggo
+package "clitkUnsharpMask"
+version "1.0"
+purpose ""
+
+option "config" - "Config file" string no
+option "verbose" v "Verbose" flag off
+
+option "imagetypes" - "Display allowed image types" flag off
+
+option "input" i "Input image filename" string yes
+option "output" o "Output image filename" string yes
+option "sigma" s "Sigma of the gaussian" double 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://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
+======================================================================-====*/
+#ifndef CLITKUnsharpMaskGENERICFILTER_H
+#define CLITKUnsharpMaskGENERICFILTER_H
+#include "clitkIO.h"
+#include "clitkImageToImageGenericFilter.h"
+
+//--------------------------------------------------------------------
+namespace clitk
+{
+
+template<class args_info_type>
+class ITK_EXPORT UnsharpMaskGenericFilter:
+ public ImageToImageGenericFilter<UnsharpMaskGenericFilter<args_info_type> >
+{
+
+public:
+
+ //--------------------------------------------------------------------
+ UnsharpMaskGenericFilter();
+
+ //--------------------------------------------------------------------
+ typedef UnsharpMaskGenericFilter 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(UnsharpMaskGenericFilter, 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 "clitkUnsharpMaskGenericFilter.txx"
+#endif
+
+#endif // #define clitkUnsharpMaskGenericFilter_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://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
+======================================================================-====*/
+#ifndef clitkUnsharpMaskGenericFilter_txx
+#define clitkUnsharpMaskGenericFilter_txx
+
+/* =================================================
+ * @file clitkUnsharpMaskGenericFilter.txx
+ * @author Jef Vandemeulebroucke <jef@creatis.insa-lyon.fr>
+ * @date 29 june 2009
+ *
+ * @brief
+ *
+ ===================================================*/
+
+// itk include
+#include "itkRecursiveGaussianImageFilter.h"
+#include "itkSubtractImageFilter.h"
+#include <clitkCommon.h>
+
+namespace clitk
+{
+
+//--------------------------------------------------------------------
+template<class args_info_type>
+UnsharpMaskGenericFilter<args_info_type>::UnsharpMaskGenericFilter():
+ ImageToImageGenericFilter<Self>("UnsharpMask") {
+ InitializeImageType<2>();
+ InitializeImageType<3>();
+ //InitializeImageType<4>();
+}
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+template<class args_info_type>
+template<unsigned int Dim>
+void UnsharpMaskGenericFilter<args_info_type>::InitializeImageType() {
+ ADD_IMAGE_TYPE(Dim, char);
+ ADD_IMAGE_TYPE(Dim, uchar);
+ ADD_IMAGE_TYPE(Dim, short);
+ ADD_IMAGE_TYPE(Dim, ushort);
+ ADD_IMAGE_TYPE(Dim, int);
+ ADD_IMAGE_TYPE(Dim, float);
+ ADD_IMAGE_TYPE(Dim, double);
+}
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+template<class args_info_type>
+void UnsharpMaskGenericFilter<args_info_type>::SetArgsInfo(const args_info_type & a) {
+ mArgsInfo=a;
+ SetIOVerbose(mArgsInfo.verbose_flag);
+ if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes();
+
+ if (mArgsInfo.input_given) {
+ SetInputFilename(mArgsInfo.input_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
+UnsharpMaskGenericFilter<args_info_type>::UpdateWithInputImageType()
+{
+
+ // Reading input
+ typename InputImageType::Pointer input = this->template GetInput<InputImageType>(0);
+
+ // Main filter
+ typedef typename InputImageType::PixelType PixelType;
+ typedef itk::Image<float, InputImageType::ImageDimension> OutputImageType;
+
+ // Filter
+ typedef itk::RecursiveGaussianImageFilter<InputImageType, OutputImageType> RecursiveGaussianImageFilterType;
+ typename RecursiveGaussianImageFilterType::Pointer gaussianFilter=RecursiveGaussianImageFilterType::New();
+ gaussianFilter->SetInput(input);
+ gaussianFilter->SetSigma(mArgsInfo.sigma_arg);
+
+ typedef itk::SubtractImageFilter<InputImageType, OutputImageType, OutputImageType> SubtractFilterType;
+ typename SubtractFilterType::Pointer subtractFilter = SubtractFilterType::New();
+ subtractFilter->SetInput1(input);
+ subtractFilter->SetInput2(gaussianFilter->GetOutput());
+ subtractFilter->Update();
+
+ this->template SetNextOutput<OutputImageType>(subtractFilter->GetOutput());
+}
+//--------------------------------------------------------------------
+
+
+}//end clitk
+
+#endif //#define clitkUnsharpMaskGenericFilter_txx
ADD_EXECUTABLE(clitkImageArithm clitkImageArithm.cxx)
TARGET_LINK_LIBRARIES(clitkImageArithm clitkCommon ITKIO ITKStatistics clitkFilters)
+ADD_EXECUTABLE(clitkUnsharpMask clitkUnsharpMask.cxx clitkUnsharpMask_ggo.c)
+TARGET_LINK_LIBRARIES(clitkUnsharpMask clitkCommon ITKIO)
+
ADD_EXECUTABLE(clitkFooImage clitkFooImage.cxx)
TARGET_LINK_LIBRARIES(clitkFooImage clitkCommon ITKIO clitkFilters)
--- /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
+======================================================================-====*/
+
+/* =================================================
+ * @file clitkUnsharpMaskGenericFilter.txx
+ * @author xxx <xxx@creatis.insa-lyon.fr>
+ * @date 29 June 2029
+ *
+ * @brief UnsharpMask an image
+ *
+ ===================================================*/
+
+// clitk
+#include "clitkUnsharpMask_ggo.h"
+#include "clitkUnsharpMaskGenericFilter.h"
+
+//--------------------------------------------------------------------
+int main(int argc, char * argv[]) {
+
+ // Init command line
+ GGO(clitkUnsharpMask, args_info);
+ CLITK_INIT;
+
+ // Filter
+ typedef clitk::UnsharpMaskGenericFilter<args_info_clitkUnsharpMask> FilterType;
+ FilterType::Pointer filter = FilterType::New();
+
+ filter->SetArgsInfo(args_info);
+ filter->Update();
+
+ return EXIT_SUCCESS;
+}// end main
+
+//--------------------------------------------------------------------
--- /dev/null
+#File clitkUnsharpMask.ggo
+package "clitkUnsharpMask"
+version "1.0"
+purpose ""
+
+option "config" - "Config file" string no
+option "verbose" v "Verbose" flag off
+
+option "imagetypes" - "Display allowed image types" flag off
+
+option "input" i "Input image filename" string yes
+option "output" o "Output image filename" string yes
+option "sigma" s "Sigma of the gaussian" double required