template<class ImageType>
void CloneImage(const typename ImageType::Pointer & input, typename ImageType::Pointer & output) {
output->SetRegions(input->GetLargestPossibleRegion());
+ output->SetOrigin(input->GetOrigin());
output->SetSpacing(input->GetSpacing());
output->Allocate();
typedef itk::ImageRegionConstIterator<ImageType> ConstIteratorType;
Program: vv
Module: $RCSfile: clitkImageToImageGenericFilterBase.cxx,v $
Language: C++
- Date: $Date: 2010/03/03 13:00:36 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2010/03/24 10:48:05 $
+ Version: $Revision: 1.3 $
Author : Joel Schaerer <joel.schaerer@creatis.insa-lyon.fr>
David Sarrut <david.sarrut@creatis.insa-lyon.fr>
:mIOVerbose(false) {
mFilterName = n;
mFailOnImageTypeError = true;
+ mReadOnDisk = true;
}
//--------------------------------------------------------------------
//--------------------------------------------------------------------
+//--------------------------------------------------------------------
+void clitk::ImageToImageGenericFilterBase::EnableReadOnDisk(bool b) {
+ mReadOnDisk = b;
+}
+//--------------------------------------------------------------------
+
+
//--------------------------------------------------------------------
void clitk::ImageToImageGenericFilterBase::SetInputFilename(const std::string & filename) {
std::vector<std::string> f;
void clitk::ImageToImageGenericFilterBase::GetInputImageDimensionAndPixelType(unsigned int& dim, \
std::string& pixeltype,unsigned int& components)
{
- if (mInputFilenames.size())
- {
- int comp_temp,dim_temp; //clitkCommonImage takes ints
- ReadImageDimensionAndPixelType(mInputFilenames[0], dim_temp, pixeltype,comp_temp);
- components=comp_temp; dim=dim_temp;
- }
- else if (mInputVVImages.size())
- {
+ if (mReadOnDisk && mInputFilenames.size()) {
+ int comp_temp,dim_temp; //clitkCommonImage takes ints
+ ReadImageDimensionAndPixelType(mInputFilenames[0], dim_temp, pixeltype,comp_temp);
+ components=comp_temp; dim=dim_temp;
+ }
+ else {
+ if (mInputVVImages.size()) {
pixeltype=mInputVVImages[0]->GetScalarTypeAsString();
dim=mInputVVImages[0]->GetNumberOfDimensions();
components=mInputVVImages[0]->GetNumberOfScalarComponents();
}
- else
+ else
assert(false); //No input image, shouldn't happen
-
+ }
if (mIOVerbose) {
std::cout << "Input is " << mDim << "D " << mPixelTypeName << "." << std::endl;
}
//--------------------------------------------------------------------
template<class ImageType>
typename ImageType::Pointer clitk::ImageToImageGenericFilterBase::GetInput(unsigned int n) {
- if (mInputFilenames.size() > n) {
+ if (mReadOnDisk && mInputFilenames.size() > n) {
return clitk::readImage<ImageType>(mInputFilenames[n], mIOVerbose);
}
- else if (mInputVVImages.size() > n)
- return typename ImageType::Pointer(const_cast<ImageType*>(vvImageToITK<ImageType>(mInputVVImages[n]).GetPointer()));
- else
- {
- assert(false); //No input, this shouldn't happen
- return typename ImageType::Pointer(NULL);
- }
+ else {
+ if (mInputVVImages.size() > n)
+ return typename ImageType::Pointer(const_cast<ImageType*>(vvImageToITK<ImageType>(mInputVVImages[n]).GetPointer()));
+ else
+ {
+ assert(false); //No input, this shouldn't happen
+ return typename ImageType::Pointer(NULL);
+ }
+ }
}
//--------------------------------------------------------------------
Program: clitk
Module: $RCSfile: clitkImageToImageGenericFilterBase.h,v $
Language: C++
- Date: $Date: 2010/03/03 13:00:36 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2010/03/24 10:48:05 $
+ Version: $Revision: 1.3 $
Author : Joel Schaerer <joel.schaerer@creatis.insa-lyon.fr>
David Sarrut <david.sarrut@creatis.insa-lyon.fr>
void SetInputFilename(const std::string & filename);
void AddInputFilename(const std::string & filename);
void SetInputFilenames(const std::vector<std::string> & filenames);
+ void EnableReadOnDisk(bool b);
void SetOutputFilename(const std::string & filename);
void AddOutputFilename(const std::string & filename);
void SetOutputFilenames(const std::vector<std::string> & filenames);
virtual bool Update() = 0;
protected:
+ bool mReadOnDisk;
/// Call this function to dispatch an output towards the correct sink
template<class ImageType>
void SetNextOutput(typename ImageType::Pointer output);
#define ADD_VEC_IMAGE_TYPE(DIM, COMP, PT) this->mImageTypesManager.template AddNewDimensionAndPixelType<DIM,COMP, PT>();
#define ADD_IMAGE_TYPE(DIM, PT) this->mImageTypesManager.template AddNewDimensionAndPixelType<DIM, PT>();
-#include "clitkImageToImageGenericFilterBase.txx"
+ //#include "clitkImageToImageGenericFilterBase.txx"
} // end namespace
SET(clitkFilters_SRC
clitkGuerreroVentilationGenericFilter.cxx
+ clitkImageArithm_ggo.c
clitkImageArithmGenericFilter.cxx
clitkImageConvertGenericFilter.cxx
clitkImageFillRegionGenericFilter.cxx
Program: clitk
Module: $RCSfile: clitkBinarizeImageGenericFilter.h,v $
Language: C++
- Date: $Date: 2010/02/03 10:54:58 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2010/03/24 10:48:09 $
+ Version: $Revision: 1.3 $
Author : Jef Vandemeulebroucke <jef@creatis.insa-lyon.fr>
David Sarrut (david.sarrut@creatis.insa-lyon.fr)
// clitk include
#include "clitkIO.h"
-#include "clitkCommon.h"
#include "clitkImageToImageGenericFilter.h"
//--------------------------------------------------------------------
#include "clitkImageArithmGenericFilter.h"
-//--------------------------------------------------------------------
-clitk::ImageArithmGenericFilter::ImageArithmGenericFilter()
- :ImageToImageGenericFilter<Self>("ImageArithmGenericFilter"),mTypeOfOperation(0) {
- InitializeImageType<2>();
- InitializeImageType<3>();
- InitializeImageType<4>();
- mIsOperationUseASecondImage = false;
-}
-//--------------------------------------------------------------------
-
-//--------------------------------------------------------------------
-template<unsigned int Dim>
-void clitk::ImageArithmGenericFilter::InitializeImageType() {
- ADD_IMAGE_TYPE(Dim, char);
- ADD_IMAGE_TYPE(Dim, short);
- ADD_IMAGE_TYPE(Dim, float);
- /* ADD_IMAGE_TYPE(Dim, short);
- ADD_IMAGE_TYPE(Dim, ushort;
- ADD_IMAGE_TYPE(Dim, int);
- ADD_IMAGE_TYPE(Dim, unsigned int);
- ADD_IMAGE_TYPE(Dim, double);
- */
-}
-//--------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------
-template<class ImageType>
-void clitk::ImageArithmGenericFilter::UpdateWithInputImageType() {
-
- // Check Input
-
- //DS TO BE CHANGED IN GetNumberOfInput() !!!!!!!!
-
- if (mInputFilenames.size() == 0) {
- std::cerr << "ERROR : please provide at least a input filename." << std::endl;
- }
- if (mInputFilenames.size() == 1) {
- mIsOperationUseASecondImage = false;
- }
- if (mInputFilenames.size() == 2) {
- mIsOperationUseASecondImage = true;
- }
- if (mInputFilenames.size() > 2) {
- std::cerr << "ERROR : please provide only 1 or 2 input filenames." << std::endl;
- }
-
- // Read input1
- // typename ImageType::Pointer input1 = clitk::readImage<ImageType>(mInputFilenames[0], mIOVerbose);
- typename ImageType::Pointer input1 = this->template GetInput<ImageType>(0);
- typename ImageType::Pointer outputImage;
-
- // Read input2 (float is ok altough it could take too memory ...)
- if (mIsOperationUseASecondImage) {
- typedef itk::Image<float,ImageType::ImageDimension> ImageType2;
- // typename ImageType2::Pointer input2 = clitk::readImage<ImageType2>(mInputFilenames[1], mIOVerbose);
- typename ImageType2::Pointer input2 = this->template GetInput<ImageType2>(1);
- outputImage = ComputeImage<ImageType, ImageType2>(input1, input2);
- }
- else {
- outputImage = ComputeImage<ImageType>(input1);
- }
-
- // Write results
- this->SetNextOutput<ImageType>(outputImage);
-}
-//--------------------------------------------------------------------
-
-//--------------------------------------------------------------------
-template<class ImageType>
-typename ImageType::Pointer
-clitk::ImageArithmGenericFilter::ComputeImage(typename ImageType::Pointer inputImage) {
-
- typedef typename ImageType::PixelType PixelType;
- typedef itk::ImageRegionIterator<ImageType> IteratorType;
- IteratorType it(inputImage, inputImage->GetLargestPossibleRegion());
- it.GoToBegin();
-
- switch (mTypeOfOperation) {
- case 0: // Addition
- while (!it.IsAtEnd()) {
- it.Set(PixelTypeDownCast<double, PixelType>((double)it.Get() + mScalar) );
- ++it;
- }
- break;
- case 1: // Multiply
- while (!it.IsAtEnd()) {
- it.Set(PixelTypeDownCast<double, PixelType>((double)it.Get() * mScalar) );
- ++it;
- }
- break;
- case 2: // Inverse
- while (!it.IsAtEnd()) {
- if (it.Get() != 0)
- it.Set(PixelTypeDownCast<double, PixelType>(mScalar / (double)it.Get()));
- else it.Set(mDefaultPixelValue);
- ++it;
- }
- break;
- case 3: // Max
- while (!it.IsAtEnd()) {
- if (it.Get() < mScalar) it.Set(PixelTypeDownCast<double, PixelType>(mScalar));
- ++it;
- }
- break;
- case 4: // Min
- while (!it.IsAtEnd()) {
- if (it.Get() > mScalar) it.Set(PixelTypeDownCast<double, PixelType>(mScalar));
- ++it;
- }
- break;
- case 5: // Absolute value
- while (!it.IsAtEnd()) {
- if (it.Get() <= 0) it.Set(PixelTypeDownCast<double, PixelType>(-it.Get()));
- // <= zero to avoid warning for unsigned types
- ++it;
- }
- break;
- case 6: // Squared value
- while (!it.IsAtEnd()) {
- it.Set(PixelTypeDownCast<double, PixelType>((double)it.Get()*(double)it.Get()));
- ++it;
- }
- break;
- case 7: // Log
- while (!it.IsAtEnd()) {
- if (it.Get() > 0)
- it.Set(PixelTypeDownCast<double, PixelType>(log((double)it.Get())));
- else it.Set(mDefaultPixelValue);
- ++it;
- }
- break;
- case 8: // exp
- while (!it.IsAtEnd()) {
- it.Set(PixelTypeDownCast<double, PixelType>(exp((double)it.Get())));
- ++it;
- }
- break;
- case 9: // sqrt
- while (!it.IsAtEnd()) {
- if (it.Get() > 0)
- it.Set(PixelTypeDownCast<double, PixelType>(sqrt((double)it.Get())));
- else {
- if (it.Get() ==0) it.Set(0);
- else it.Set(mDefaultPixelValue);
- }
- ++it;
- }
- break;
- default: // error ?
- std::cerr << "ERROR : the operation number (" << mTypeOfOperation << ") is not known." << std::endl;
- exit(-1);
- }
-
- return inputImage;
-}
-//--------------------------------------------------------------------
-
-//--------------------------------------------------------------------
-template<class ImageType1, class ImageType2>
-typename ImageType1::Pointer
-clitk::ImageArithmGenericFilter::ComputeImage(typename ImageType1::Pointer inputImage1,
- typename ImageType2::Pointer inputImage2) {
-
- typedef typename ImageType1::PixelType PixelType;
- typedef itk::ImageRegionIterator<ImageType1> IteratorType;
- IteratorType it1(inputImage1, inputImage1->GetLargestPossibleRegion());
- it1.GoToBegin();
-
- typedef itk::ImageRegionConstIterator<ImageType2> ConstIteratorType;
- ConstIteratorType it2(inputImage2, inputImage2->GetLargestPossibleRegion());
- it2.GoToBegin();
-
- switch (mTypeOfOperation) {
- case 0: // Addition
- while (!it1.IsAtEnd()) {
- it1.Set(PixelTypeDownCast<double, PixelType>((double)it1.Get() + (double)it2.Get()) );
- ++it1; ++it2;
- }
- break;
- case 1: // Multiply
- while (!it1.IsAtEnd()) {
- it1.Set(PixelTypeDownCast<double, PixelType>((double)it1.Get() * (double)it2.Get()) );
- ++it1; ++it2;
- }
- break;
- case 2: // Divide
- while (!it1.IsAtEnd()) {
- if (it1.Get() != 0)
- it1.Set(PixelTypeDownCast<double, PixelType>((double)it1.Get() / (double)it2.Get()));
- else it1.Set(mDefaultPixelValue);
- ++it1; ++it2;
- }
- break;
- case 3: // Max
- while (!it1.IsAtEnd()) {
- if (it1.Get() < it2.Get()) it1.Set(PixelTypeDownCast<double, PixelType>(it2.Get()));
- ++it1; ++it2;
- }
- break;
- case 4: // Min
- while (!it1.IsAtEnd()) {
- if (it1.Get() > it2.Get()) it1.Set(PixelTypeDownCast<double, PixelType>(it2.Get()));
- ++it1; ++it2;
- }
- break;
- case 5: // Absolute difference
- while (!it1.IsAtEnd()) {
- it1.Set(PixelTypeDownCast<double, PixelType>(fabs(it2.Get()-it1.Get())));
- ++it1; ++it2;
- }
- break;
- case 6: // Squared differences
- while (!it1.IsAtEnd()) {
- it1.Set(PixelTypeDownCast<double, PixelType>(pow((double)it1.Get()-(double)it2.Get(),2)));
- ++it1; ++it2;
- }
- break;
- case 7: // Difference
- while (!it1.IsAtEnd()) {
- it1.Set(PixelTypeDownCast<double, PixelType>((double)it1.Get()-(double)it2.Get()));
- ++it1; ++it2;
- }
- break;
- case 8: // Relative Difference
- while (!it1.IsAtEnd()) {
- if (it1.Get() != 0) it1.Set(PixelTypeDownCast<double, PixelType>(((double)it1.Get()-(double)it2.Get()))/(double)it1.Get());
- else it1.Set(0.0);
- ++it1; ++it2;
- }
- break;
- default: // error ?
- std::cerr << "ERROR : the operation number (" << mTypeOfOperation << ") is not known." << std::endl;
- exit(-1);
- }
-
- return inputImage1;
-}
-//--------------------------------------------------------------------
#endif //define CLITKIMAGEARITHMGENERICFILTER_CXX
// clitk include
#include "clitkCommon.h"
-#include "clitkImageCommon.h"
#include "clitkImageToImageGenericFilter.h"
// itk include
#include "itkImageRegionIterator.h"
#include "itkImageRegionConstIterator.h"
+//--------------------------------------------------------------------
namespace clitk {
- //--------------------------------------------------------------------
- // Main class for an Image Resample Generic Filter
- // (multiple dimensions, multiple pixel types)
- class ImageArithmGenericFilter:
- public clitk::ImageToImageGenericFilter<ImageArithmGenericFilter> {
-
+ template<class args_info_type>
+ class ITK_EXPORT ImageArithmGenericFilter:
+ public clitk::ImageToImageGenericFilter<ImageArithmGenericFilter<args_info_type> > {
+
public:
// Constructor
ImageArithmGenericFilter ();
// Types
- typedef ImageArithmGenericFilter Self;
- typedef ImageToImageGenericFilterBase Superclass;
- typedef itk::SmartPointer<Self> Pointer;
- typedef itk::SmartPointer<const Self> ConstPointer;
+ typedef ImageArithmGenericFilter Self;
+ typedef ImageToImageGenericFilterBase Superclass;
+ typedef itk::SmartPointer<Self> Pointer;
+ typedef itk::SmartPointer<const Self> ConstPointer;
// New
itkNewMacro(Self);
+ //--------------------------------------------------------------------
+ void SetArgsInfo(const args_info_type & a);
+
// Set methods
void SetDefaultPixelValue (double value) { mDefaultPixelValue = value ;}
void SetTypeOfOperation (int value) { mTypeOfOperation = value ;}
void SetScalar (double value) { mScalar = value ;}
+ void EnableOverwriteInputImage(bool b);
// Get methods
double GetDefaultPixelValue () { return mDefaultPixelValue ;}
double mScalar;
double mDefaultPixelValue;
int mTypeOfOperation;
+ args_info_type mArgsInfo;
+ bool mOverwriteInputImage;
+ bool mOutputIsFloat;
+
+ template<class Iter1, class Iter2>
+ void ComputeImage(Iter1 it, Iter2 ito);
- template<class ImageType>
- typename ImageType::Pointer ComputeImage(typename ImageType::Pointer inputImage);
+ template<class Iter1, class Iter2, class Iter3>
+ void ComputeImage(Iter1 it1, Iter2 it2, Iter3 ito);
- template<class ImageType1, class ImageType2>
- typename ImageType1::Pointer
- ComputeImage(typename ImageType1::Pointer inputImage1,
- typename ImageType2::Pointer inputImage2);
//--------------------------------------------------------------------
}; // end class ImageArithmGenericFilter
-//--------------------------------------------------------------------
-
-//#include "clitkImageArithmGenericFilter.txx"
-
} // end namespace
//--------------------------------------------------------------------
+#ifndef ITK_MANUAL_INSTANTIATION
+#include "clitkImageArithmGenericFilter.txx"
+#endif
+
#endif //#define CLITKIMAGEARITHMGENERICFILTER_H
#ifndef CLITKIMAGEARITHMGENERICFILTER_TXX
#define CLITKIMAGEARITHMGENERICFILTER_TXX
-/*-------------------------------------------------
- * @file clitkImageArithmGenericFilter.txx
- * @author David Sarrut <David.Sarrut@creatis.insa-lyon.fr>
- * @date 9 August 2006
- *
- -------------------------------------------------*/
-
-//--------------------------------------------------------------------
-template<unsigned int Dim>
-void ImageArithmGenericFilter::Update_WithDim() {
-#define TRY_TYPE(TYPE) \
- if (IsSameType<TYPE>(mPixelTypeName)) { Update_WithDimAndPixelType<Dim, TYPE>(); return; }
- TRY_TYPE(char);
- TRY_TYPE(uchar);
- TRY_TYPE(short);
- TRY_TYPE(ushort);
- TRY_TYPE(int);
- TRY_TYPE(unsigned int);
- TRY_TYPE(float);
- TRY_TYPE(double);
-#undef TRY_TYPE
-
- std::string list = CreateListOfTypes<char, uchar, short, ushort, int, uint, float, double>();
- std::cerr << "Error, I don't know the type '" << mPixelTypeName << "' for the input image '"
- << mInputFilenames[0] << "'." << std::endl << "Known types are " << list << std::endl;
- exit(0);
-}
-//--------------------------------------------------------------------
-
-//--------------------------------------------------------------------
-template<unsigned int Dim, class PixelType>
-void ImageArithmGenericFilter::Update_WithDimAndPixelType() {
- // Read input1
- typedef itk::Image<PixelType,Dim> ImageType;
- typename ImageType::Pointer input1 = clitk::readImage<ImageType>(mInputFilenames[0], mIOVerbose);
- typename ImageType::Pointer outputImage;
-
- // Read input2 (float is ok altough it could take too memory ...)
- if (mIsOperationUseASecondImage) {
- typedef itk::Image<float,Dim> ImageType2;
- typename ImageType2::Pointer input2 = clitk::readImage<ImageType2>(mInputFilenames[1], mIOVerbose);
- outputImage = ComputeImage<ImageType, ImageType2>(input1, input2);
+namespace clitk
+{
+
+ //--------------------------------------------------------------------
+ template<class args_info_type>
+ ImageArithmGenericFilter<args_info_type>::ImageArithmGenericFilter()
+ :ImageToImageGenericFilter<Self>("ImageArithmGenericFilter"),mTypeOfOperation(0) {
+ InitializeImageType<2>();
+ InitializeImageType<3>();
+ InitializeImageType<4>();
+ mIsOperationUseASecondImage = false;
+ mOverwriteInputImage = true;
}
- else {
- outputImage = ComputeImage<ImageType>(input1);
+ //--------------------------------------------------------------------
+
+
+ //--------------------------------------------------------------------
+ template<class args_info_type>
+ template<unsigned int Dim>
+ void ImageArithmGenericFilter<args_info_type>::InitializeImageType() {
+ ADD_IMAGE_TYPE(Dim, char);
+ ADD_IMAGE_TYPE(Dim, short);
+ ADD_IMAGE_TYPE(Dim, float);
}
+ //--------------------------------------------------------------------
- // Write results
- this->SetNextOutput<ImageType>(outputImage);
- //clitk::writeImage<ImageType>(outputImage, mOutputFilename, mIOVerbose);
-}
-//--------------------------------------------------------------------
-
-//--------------------------------------------------------------------
-template<class ImageType>
-typename ImageType::Pointer
-ImageArithmGenericFilter::ComputeImage(typename ImageType::Pointer inputImage) {
-
- typedef typename ImageType::PixelType PixelType;
- typedef itk::ImageRegionIterator<ImageType> IteratorType;
- IteratorType it(inputImage, inputImage->GetLargestPossibleRegion());
- it.GoToBegin();
-
- switch (mTypeOfOperation) {
- case 0: // Addition
- while (!it.IsAtEnd()) {
- it.Set(PixelTypeDownCast<double, PixelType>((double)it.Get() + mScalar) );
- ++it;
- }
- break;
- case 1: // Multiply
- while (!it.IsAtEnd()) {
- it.Set(PixelTypeDownCast<double, PixelType>((double)it.Get() * mScalar) );
- ++it;
- }
- break;
- case 2: // Inverse
- while (!it.IsAtEnd()) {
- if (it.Get() != 0)
- it.Set(PixelTypeDownCast<double, PixelType>(mScalar / (double)it.Get()));
- else it.Set(mDefaultPixelValue);
- ++it;
- }
- break;
- case 3: // Max
- while (!it.IsAtEnd()) {
- if (it.Get() < mScalar) it.Set(PixelTypeDownCast<double, PixelType>(mScalar));
- ++it;
- }
- break;
- case 4: // Min
- while (!it.IsAtEnd()) {
- if (it.Get() > mScalar) it.Set(PixelTypeDownCast<double, PixelType>(mScalar));
- ++it;
- }
- break;
- case 5: // Absolute value
- while (!it.IsAtEnd()) {
- if (it.Get() <= 0) it.Set(PixelTypeDownCast<double, PixelType>(-it.Get()));
- // <= zero to avoid warning for unsigned types
- ++it;
- }
- break;
- case 6: // Squared value
- while (!it.IsAtEnd()) {
- it.Set(PixelTypeDownCast<double, PixelType>((double)it.Get()*(double)it.Get()));
- ++it;
- }
- break;
- case 7: // Log
- while (!it.IsAtEnd()) {
- if (it.Get() > 0)
- it.Set(PixelTypeDownCast<double, PixelType>(log((double)it.Get())));
- else it.Set(mDefaultPixelValue);
- ++it;
+
+ //--------------------------------------------------------------------
+ template<class args_info_type>
+ void ImageArithmGenericFilter<args_info_type>::EnableOverwriteInputImage(bool b) {
+ mOverwriteInputImage = b;
+ }
+ //--------------------------------------------------------------------
+
+
+ //--------------------------------------------------------------------
+ template<class args_info_type>
+ void ImageArithmGenericFilter<args_info_type>::SetArgsInfo(const args_info_type & a) {
+ mArgsInfo=a;
+
+ // Set value
+ SetIOVerbose(mArgsInfo.verbose_flag);
+ mTypeOfOperation = mArgsInfo.operation_arg;
+ mDefaultPixelValue = mArgsInfo.pixelValue_arg;
+ mScalar = mArgsInfo.scalar_arg;
+ mOutputIsFloat = mArgsInfo.setFloatOutput_flag;
+
+ if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes();
+
+ if (mArgsInfo.input1_given) AddInputFilename(mArgsInfo.input1_arg);
+ if (mArgsInfo.input2_given) {
+ mIsOperationUseASecondImage = true;
+ AddInputFilename(mArgsInfo.input2_arg);
}
- break;
- case 8: // exp
- while (!it.IsAtEnd()) {
- it.Set(PixelTypeDownCast<double, PixelType>(exp((double)it.Get())));
- ++it;
+
+ if (mArgsInfo.output_given) SetOutputFilename(mArgsInfo.output_arg);
+
+ // Check type of operation (with scalar or with other image)
+ if ((mArgsInfo.input2_given) && (mArgsInfo.scalar_given)) {
+ std::cerr << "ERROR : you cannot provide both --scalar and --input2 option" << std::endl;
+ exit(-1);
}
- break;
- case 9: // sqrt
- while (!it.IsAtEnd()) {
- if (it.Get() > 0)
- it.Set(PixelTypeDownCast<double, PixelType>(sqrt((double)it.Get())));
- else {
- if (it.Get() ==0) it.Set(0);
- else it.Set(mDefaultPixelValue);
+ if ((!mArgsInfo.input2_given) && (!mArgsInfo.scalar_given)) {
+ if (mArgsInfo.operation_arg < 5) {
+ std::cerr << "Such operation need the --scalar option." << std::endl;
+ exit(-1);
}
- ++it;
}
- break;
- default: // error ?
- std::cerr << "ERROR : the operation number (" << mTypeOfOperation << ") is not known." << std::endl;
- exit(-1);
}
+ //--------------------------------------------------------------------
- return inputImage;
-}
-//--------------------------------------------------------------------
-//--------------------------------------------------------------------
-template<class ImageType1, class ImageType2>
-typename ImageType1::Pointer
-ImageArithmGenericFilter::ComputeImage(typename ImageType1::Pointer inputImage1,
- typename ImageType2::Pointer inputImage2) {
+ //--------------------------------------------------------------------
+ template<class args_info_type>
+ template<class ImageType>
+ void ImageArithmGenericFilter<args_info_type>::UpdateWithInputImageType() {
+ // Read input1
+ typename ImageType::Pointer input1 = this->template GetInput<ImageType>(0);
+ typename ImageType::PixelType PixelType;
- typedef typename ImageType1::PixelType PixelType;
- typedef itk::ImageRegionIterator<ImageType1> IteratorType;
- IteratorType it1(inputImage1, inputImage1->GetLargestPossibleRegion());
- it1.GoToBegin();
-
- typedef itk::ImageRegionConstIterator<ImageType2> ConstIteratorType;
- ConstIteratorType it2(inputImage2, inputImage2->GetLargestPossibleRegion());
- it2.GoToBegin();
-
- switch (mTypeOfOperation) {
- case 0: // Addition
- while (!it1.IsAtEnd()) {
- it1.Set(PixelTypeDownCast<double, PixelType>((double)it1.Get() + (double)it2.Get()) );
- ++it1; ++it2;
- }
- break;
- case 1: // Multiply
- while (!it1.IsAtEnd()) {
- it1.Set(PixelTypeDownCast<double, PixelType>((double)it1.Get() * (double)it2.Get()) );
- ++it1; ++it2;
- }
- break;
- case 2: // Divide
- while (!it1.IsAtEnd()) {
- if (it1.Get() != 0)
- it1.Set(PixelTypeDownCast<double, PixelType>((double)it1.Get() / (double)it2.Get()));
- else it1.Set(mDefaultPixelValue);
- ++it1; ++it2;
- }
- break;
- case 3: // Max
- while (!it1.IsAtEnd()) {
- if (it1.Get() < it2.Get()) it1.Set(PixelTypeDownCast<double, PixelType>(it2.Get()));
- ++it1; ++it2;
+ // Set input image iterator
+ typedef itk::ImageRegionIterator<ImageType> IteratorType;
+ IteratorType it(input1, input1->GetLargestPossibleRegion());
+
+ // typedef input2
+ typename ImageType::Pointer input2 = this->template GetInput<ImageType>(1);
+ IteratorType it2;
+
+ if (mIsOperationUseASecondImage) {
+ // Read input2
+ input2 = this->template GetInput<ImageType>(1);
+ // Set input image iterator
+ it2 = IteratorType(input2, input2->GetLargestPossibleRegion());
}
- break;
- case 4: // Min
- while (!it1.IsAtEnd()) {
- if (it1.Get() > it2.Get()) it1.Set(PixelTypeDownCast<double, PixelType>(it2.Get()));
- ++it1; ++it2;
+
+ // Check if overwrite and outputisfloat and pixeltype is not float -> do not overwrite
+ if (mOverwriteInputImage && mOutputIsFloat && (typeid(PixelType) != typeid(float))) {
+ // std::cerr << "Warning. Could not use both mOverwriteInputImage and mOutputIsFloat, because input is "
+ // << typeid(PixelType).name()
+ // << std::endl;
+ mOverwriteInputImage = false;
}
- break;
- case 5: // Absolute difference
- while (!it1.IsAtEnd()) {
- it1.Set(PixelTypeDownCast<double, PixelType>(fabs(it2.Get()-it1.Get())));
- ++it1; ++it2;
+
+ // ---------------- Overwrite input Image ---------------------
+ if (mOverwriteInputImage) {
+ // Set output iterator (to input1)
+ IteratorType ito = IteratorType(input1, input1->GetLargestPossibleRegion());
+ if (mIsOperationUseASecondImage) ComputeImage(it, it2, ito);
+ else ComputeImage(it, ito);
+ this->template SetNextOutput<ImageType>(input1);
}
- break;
- case 6: // Squared differences
- while (!it1.IsAtEnd()) {
- it1.Set(PixelTypeDownCast<double, PixelType>(pow((double)it1.Get()-(double)it2.Get(),2)));
- ++it1; ++it2;
+
+ // ---------------- Create new output Image ---------------------
+ else {
+ if (mOutputIsFloat) {
+ // Create output image
+ typedef itk::Image<float,ImageType::ImageDimension> OutputImageType;
+ typename OutputImageType::Pointer output = OutputImageType::New();
+ output->SetRegions(input1->GetLargestPossibleRegion());
+ output->SetOrigin(input1->GetOrigin());
+ output->SetSpacing(input1->GetSpacing());
+ output->Allocate();
+ // Set output iterator
+ typedef itk::ImageRegionIterator<OutputImageType> IteratorOutputType;
+ IteratorOutputType ito = IteratorOutputType(output, output->GetLargestPossibleRegion());
+ if (mIsOperationUseASecondImage) ComputeImage(it, it2, ito);
+ else ComputeImage(it, ito);
+ this->template SetNextOutput<OutputImageType>(output);
+ }
+ else {
+ // Create output image
+ typedef ImageType OutputImageType;
+ typename OutputImageType::Pointer output = OutputImageType::New();
+ output->SetRegions(input1->GetLargestPossibleRegion());
+ output->SetOrigin(input1->GetOrigin());
+ output->SetSpacing(input1->GetSpacing());
+ output->Allocate();
+ // Set output iterator
+ typedef itk::ImageRegionIterator<OutputImageType> IteratorOutputType;
+ IteratorOutputType ito = IteratorOutputType(output, output->GetLargestPossibleRegion());
+ if (mIsOperationUseASecondImage) ComputeImage(it, it2, ito);
+ else ComputeImage(it, ito);
+ this->template SetNextOutput<OutputImageType>(output);
+ }
}
- break;
- case 7: // Difference
- while (!it1.IsAtEnd()) {
- it1.Set(PixelTypeDownCast<double, PixelType>((double)it1.Get()-(double)it2.Get()));
- ++it1; ++it2;
+ }
+ //--------------------------------------------------------------------
+
+ //--------------------------------------------------------------------
+ template<class args_info_type>
+ template<class Iter1, class Iter2, class Iter3>
+ void ImageArithmGenericFilter<args_info_type>::ComputeImage(Iter1 it1, Iter2 it2, Iter3 ito) {
+ it1.GoToBegin();
+ it2.GoToBegin();
+ ito.GoToBegin();
+ typedef typename Iter3::PixelType PixelType;
+
+ switch (mTypeOfOperation) {
+ case 0: // Addition
+ while (!ito.IsAtEnd()) {
+ ito.Set(PixelTypeDownCast<double, PixelType>((double)it1.Get() + (double)it2.Get()) );
+ ++it1; ++it2; ++ito;
+ }
+ break;
+ case 1: // Multiply
+ while (!ito.IsAtEnd()) {
+ ito.Set(PixelTypeDownCast<double, PixelType>((double)it1.Get() * (double)it2.Get()) );
+ ++it1; ++it2; ++ito;
+ }
+ break;
+ case 2: // Divide
+ while (!ito.IsAtEnd()) {
+ if (it1.Get() != 0)
+ ito.Set(PixelTypeDownCast<double, PixelType>((double)it1.Get() / (double)it2.Get()));
+ else ito.Set(mDefaultPixelValue);
+ ++it1; ++it2; ++ito;
+ }
+ break;
+ case 3: // Max
+ while (!ito.IsAtEnd()) {
+ if (it1.Get() < it2.Get()) ito.Set(PixelTypeDownCast<double, PixelType>(it2.Get()));
+ ++it1; ++it2; ++ito;
+ }
+ break;
+ case 4: // Min
+ while (!ito.IsAtEnd()) {
+ if (it1.Get() > it2.Get()) ito.Set(PixelTypeDownCast<double, PixelType>(it2.Get()));
+ ++it1; ++it2; ++ito;
+ }
+ break;
+ case 5: // Absolute difference
+ while (!ito.IsAtEnd()) {
+ ito.Set(PixelTypeDownCast<double, PixelType>(fabs(it2.Get()-it1.Get())));
+ ++it1; ++it2; ++ito;
+ }
+ break;
+ case 6: // Squared differences
+ while (!ito.IsAtEnd()) {
+ ito.Set(PixelTypeDownCast<double, PixelType>(pow((double)it1.Get()-(double)it2.Get(),2)));
+ ++it1; ++it2; ++ito;
+ }
+ break;
+ case 7: // Difference
+ while (!ito.IsAtEnd()) {
+ ito.Set(PixelTypeDownCast<double, PixelType>((double)it1.Get()-(double)it2.Get()));
+ ++it1; ++it2; ++ito;
+ }
+ break;
+ case 8: // Relative Difference
+ while (!ito.IsAtEnd()) {
+ if (it1.Get() != 0) ito.Set(PixelTypeDownCast<double, PixelType>(((double)it1.Get()-(double)it2.Get()))/(double)it1.Get());
+ else ito.Set(0.0);
+ ++it1; ++it2; ++ito;
+ }
+ break;
+ default: // error ?
+ std::cerr << "ERROR : the operation number (" << mTypeOfOperation << ") is not known." << std::endl;
+ exit(-1);
}
- break;
- case 8: // Relative Difference
- while (!it1.IsAtEnd()) {
- if (it1.Get() != 0) it1.Set(PixelTypeDownCast<double, PixelType>(((double)it1.Get()-(double)it2.Get()))/(double)it1.Get());
- else it1.Set(0.0);
- ++it1; ++it2;
+ }
+ //--------------------------------------------------------------------
+
+
+ //--------------------------------------------------------------------
+ template<class args_info_type>
+ template<class Iter1, class Iter2>
+ void clitk::ImageArithmGenericFilter<args_info_type>::ComputeImage(Iter1 it, Iter2 ito) {
+ ito.GoToBegin();
+ it.GoToBegin();
+ typedef typename Iter2::PixelType PixelType;
+
+ // Perform operation
+ switch (mTypeOfOperation) {
+ case 0: // Addition
+ while (!it.IsAtEnd()) {
+ ito.Set(clitk::PixelTypeDownCast<double, PixelType>((double)it.Get() + mScalar) );
+ ++it; ++ito;
+ }
+ break;
+ case 1: // Multiply
+ while (!it.IsAtEnd()) {
+ ito.Set(PixelTypeDownCast<double, PixelType>((double)it.Get() * mScalar) );
+ ++it; ++ito;
+ }
+ break;
+ case 2: // Inverse
+ while (!it.IsAtEnd()) {
+ if (it.Get() != 0)
+ ito.Set(PixelTypeDownCast<double, PixelType>(mScalar / (double)it.Get()));
+ else ito.Set(mDefaultPixelValue);
+ ++it; ++ito;
+ }
+ break;
+ case 3: // Max
+ while (!it.IsAtEnd()) {
+ if (it.Get() < mScalar) ito.Set(PixelTypeDownCast<double, PixelType>(mScalar));
+ ++it; ++ito;
+ }
+ break;
+ case 4: // Min
+ while (!it.IsAtEnd()) {
+ if (it.Get() > mScalar) ito.Set(PixelTypeDownCast<double, PixelType>(mScalar));
+ ++it; ++ito;
+ }
+ break;
+ case 5: // Absolute value
+ while (!it.IsAtEnd()) {
+ if (it.Get() <= 0) ito.Set(PixelTypeDownCast<double, PixelType>(-it.Get()));
+ // <= zero to avoid warning for unsigned types
+ ++it; ++ito;
+ }
+ break;
+ case 6: // Squared value
+ while (!it.IsAtEnd()) {
+ ito.Set(PixelTypeDownCast<double, PixelType>((double)it.Get()*(double)it.Get()));
+ ++it; ++ito;
+ }
+ break;
+ case 7: // Log
+ while (!it.IsAtEnd()) {
+ if (it.Get() > 0)
+ ito.Set(PixelTypeDownCast<double, PixelType>(log((double)it.Get())));
+ else ito.Set(mDefaultPixelValue);
+ ++it; ++ito;
+ }
+ break;
+ case 8: // exp
+ while (!it.IsAtEnd()) {
+ ito.Set(PixelTypeDownCast<double, PixelType>(exp((double)it.Get())));
+ ++it; ++ito;
+ }
+ break;
+ case 9: // sqrt
+ while (!it.IsAtEnd()) {
+ if (it.Get() > 0)
+ ito.Set(PixelTypeDownCast<double, PixelType>(sqrt((double)it.Get())));
+ else {
+ if (it.Get() ==0) ito.Set(0);
+ else ito.Set(mDefaultPixelValue);
+ }
+ ++it; ++ito;
+ }
+ break;
+ default: // error ?
+ std::cerr << "ERROR : the operation number (" << mTypeOfOperation << ") is not known." << std::endl;
+ exit(-1);
}
- break;
- default: // error ?
- std::cerr << "ERROR : the operation number (" << mTypeOfOperation << ") is not known." << std::endl;
- exit(-1);
}
+ //--------------------------------------------------------------------
- return inputImage1;
-}
-//--------------------------------------------------------------------
+} // end namespace
#endif //#define CLITKIMAGEARITHMGENERICFILTER_TXX
template<unsigned int Dim>
void clitk::ImageResampleGenericFilter::InitializeImageTypeWithDim() {
ADD_IMAGE_TYPE(Dim, char);
+ ADD_IMAGE_TYPE(Dim, unsigned char);
ADD_IMAGE_TYPE(Dim, short);
ADD_IMAGE_TYPE(Dim, int);
ADD_IMAGE_TYPE(Dim, float);
ADD_EXECUTABLE(clitkVFResample clitkVFResample.cxx clitkImageResample_ggo.c)
TARGET_LINK_LIBRARIES(clitkVFResample clitkCommon ITKIO clitkFilters)
-ADD_EXECUTABLE(clitkImageArithm clitkImageArithm.cxx clitkImageArithm_ggo.c)
-TARGET_LINK_LIBRARIES(clitkImageArithm clitkCommon ITKIO ITKStatistics clitkFilters)
-
ADD_EXECUTABLE(clitkImageCreate clitkImageCreate.cxx clitkImageCreate_ggo.c)
TARGET_LINK_LIBRARIES(clitkImageCreate clitkCommon ITKStatistics ITKIO)
TARGET_LINK_LIBRARIES(clitkGuerreroVentilation clitkCommon ITKIO ITKBasicFilters
clitkFilters)
+ADD_EXECUTABLE(clitkImageArithm clitkImageArithm.cxx)
+TARGET_LINK_LIBRARIES(clitkImageArithm clitkCommon ITKIO ITKStatistics clitkFilters)
+
ADD_EXECUTABLE(clitkBinarizeImage clitkBinarizeImage.cxx)
TARGET_LINK_LIBRARIES(clitkBinarizeImage clitkCommon ITKIO clitkFilters)
CLITK_INIT;
// Filter
- clitk::BinarizeImageGenericFilter<args_info_clitkBinarizeImage>::Pointer filter =
- clitk::BinarizeImageGenericFilter<args_info_clitkBinarizeImage>::New();
+ typedef clitk::BinarizeImageGenericFilter<args_info_clitkBinarizeImage> FilterType;
+ FilterType::Pointer filter = FilterType::New();
filter->SetArgsInfo(args_info);
filter->Update();
// clitk include
#include "clitkImageArithm_ggo.h"
#include "clitkImageArithmGenericFilter.h"
-#include "clitkIO.h"
//--------------------------------------------------------------------
int main(int argc, char * argv[]) {
// Init command line
GGO(clitkImageArithm, args_info);
- CLITK_INIT;
- // Check that we have either the 2nd image or the scalar
- if ((args_info.input2_given) && (args_info.scalar_given)) {
- std::cerr << "ERROR : you cannot provide both --scalar and --input2 option" << std::endl;
- exit(-1);
- }
- if ((!args_info.input2_given) && (!args_info.scalar_given)) {
- if (args_info.operation_arg < 5) {
- std::cerr << "Such operation need the --scalar option." << std::endl;
- exit(-1);
- }
- }
-
- // Read input image header1 to check image dimension
- itk::ImageIOBase::Pointer header1 = clitk::readImageHeader(args_info.input1_arg);
- unsigned int dim1 = header1->GetNumberOfDimensions();
- std::string pixelTypeName = header1->GetComponentTypeAsString(header1->GetComponentType());
-
- // Options for arithm operation between 2 images
- if (args_info.input2_given) {
-
- itk::ImageIOBase::Pointer header2 = clitk::readImageHeader(args_info.input2_arg);
- unsigned int dim2 = header2->GetNumberOfDimensions();
- std::string pixelTypeName2 = header2->GetComponentTypeAsString(header1->GetComponentType());
-
- // Check dimension
- if (dim1 != dim2) {
- std::cerr << "Images should have the same dimension : " <<std::endl;
- std::cerr << "Dim input1 = " << dim1 << std::endl;
- std::cerr << "Dim input2 = " << dim2 << std::endl;
- exit(-1);
- }
-
- // Check same type of pixel in both images
- if (pixelTypeName2 != pixelTypeName) {
- std::cerr << "Input images do not have the same pixel type: " <<std::endl;
- std::cerr << "Type input1 = " << pixelTypeName << std::endl;
- std::cerr << "Type input2 = " << pixelTypeName2 << std::endl;
- exit(-1);
- }
-
- // Check same X,Y dimensions in both images
- for(int i=0; i<2; i++) {
- if ( header1->GetDimensions(i) != header2->GetDimensions(i) ) {
- std::cerr << "ERROR: input images should have same X and Y size. " << std::endl;
- std::cerr << "Dimensions X and Y of input1: = " << header1->GetDimensions(0) <<" "<< header1->GetDimensions(1)<< std::endl;
- std::cerr << "Dimensions X and Y of input2: = " << header2->GetDimensions(0) <<" "<< header2->GetDimensions(1)<< std::endl;
- exit(-1);
- }
- }//end for
- if (dim1 == 3) {
- if (header1->GetDimensions(2) < header2->GetDimensions(2)) {
- std::cerr << "ERROR: Z size in input1 is greater than in input2. " << std::endl;
- std::cerr << "Size input1 : " << header1->GetDimensions(0) << " " << header1->GetDimensions(1)<< " " << header1->GetDimensions(2) << std::endl;
- std::cerr << "Size input2 : " << header2->GetDimensions(0) << " " << header2->GetDimensions(1)<< " " << header2->GetDimensions(2) << std::endl;
- }
- }
- } //end if operation between 2 images
-
// Creation of a generic filter
- clitk::ImageArithmGenericFilter::Pointer filter = clitk::ImageArithmGenericFilter::New();
- filter->AddInputFilename(args_info.input1_arg);
- if (args_info.input2_given) filter->AddInputFilename(args_info.input2_arg);
- else filter->SetScalar(args_info.scalar_arg);
- //if (args_info.binary_given) filter->SetBinaryMaskFilename(args_info.binary_arg);
- filter->SetTypeOfOperation(args_info.operation_arg);
- filter->SetDefaultPixelValue(args_info.pixelValue_arg);
- filter->SetOutputFilename(args_info.output_arg);
+ typedef clitk::ImageArithmGenericFilter<args_info_clitkImageArithm> FilterType;
+ FilterType::Pointer filter = FilterType::New();
- // Go !
+ // Go !
+ filter->SetArgsInfo(args_info);
filter->Update();
-
+
// this is the end my friend
- return 0;
+ return EXIT_SUCCESS;
} // end main
#endif //define CLITKIMAGEARITHM_CXX
vvToolSimpleInputSelectorWidget.cxx
vvToolInputSelectorWidget.cxx
vvImageContour.cxx
+ vvToolImageArithm.cxx
)
QT4_WRAP_CPP(vv_SRCS
vvToolInputSelectorWidget.h
vvToolWidgetBase.h
vvToolCropImage.h
+ vvToolImageArithm.h
)
QT4_WRAP_UI(vv_UI_CXX
qt_ui/vvStructSelector.ui
qt_ui/vvDummyWindow.ui #For testing
qt_ui/vvIntensityValueSlider.ui
+ qt_ui/vvToolSimpleInputSelectorWidget.ui
+ qt_ui/vvToolInputSelectorWidget.ui
qt_ui/vvToolWidgetBase.ui
# qt_ui/vvToolFoo.ui
qt_ui/vvToolCropImage.ui
qt_ui/vvToolBinarize.ui
- qt_ui/vvToolSimpleInputSelectorWidget.ui
- qt_ui/vvToolInputSelectorWidget.ui
+ qt_ui/vvToolImageArithm.ui
)
SET(vvUI_RCCS vvIcons.qrc)
<rect>
<x>0</x>
<y>0</y>
- <width>573</width>
- <height>125</height>
+ <width>407</width>
+ <height>82</height>
</rect>
</property>
<property name="windowTitle">
<number>0</number>
</property>
<item row="0" column="0">
- <widget class="QGroupBox" name="groupBox">
+ <widget class="QGroupBox" name="mGroupBox">
<property name="font">
<font>
<weight>75</weight>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
- <widget class="QGroupBox" name="groupBox_2">
- <property name="font">
- <font>
- <weight>50</weight>
- <bold>false</bold>
- </font>
- </property>
- <property name="title">
- <string>Already open</string>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <property name="margin">
- <number>1</number>
- </property>
- <item row="0" column="0">
- <widget class="QComboBox" name="mInputSequenceBox">
- <property name="font">
- <font>
- <pointsize>11</pointsize>
- <weight>50</weight>
- <bold>false</bold>
- </font>
- </property>
- <item>
- <property name="text">
- <string>Bidon image number 1</string>
- </property>
- </item>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="mRadioButtonLowerThan">
- <property name="font">
- <font>
- <weight>50</weight>
- <bold>false</bold>
- </font>
- </property>
- <property name="text">
- <string>OR</string>
- </property>
- <property name="autoExclusive">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="groupBox_3">
+ <widget class="QComboBox" name="mInputSequenceBox">
<property name="enabled">
- <bool>false</bool>
+ <bool>true</bool>
</property>
<property name="font">
<font>
+ <pointsize>11</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
- <property name="title">
- <string>Open a new file</string>
- </property>
- <layout class="QHBoxLayout" name="horizontalLayout_4">
- <property name="leftMargin">
- <number>3</number>
- </property>
- <property name="topMargin">
- <number>3</number>
- </property>
- <property name="rightMargin">
- <number>3</number>
- </property>
- <property name="bottomMargin">
- <number>1</number>
+ <item>
+ <property name="text">
+ <string>Bidon image number 1</string>
</property>
- <item>
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>Or open a new one</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="toolButton">
- <property name="text">
- <string>...</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="lineEdit">
- <property name="text">
- <string>/home/toto/truc.mhd</string>
- </property>
- </widget>
- </item>
- </layout>
+ </item>
</widget>
</item>
</layout>
<enum>QFrame::NoFrame</enum>
</property>
<property name="text">
- <string>3D image Pixel type short bla bla</string>
+ <string>No selected image</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
- <connections>
- <connection>
- <sender>mRadioButtonLowerThan</sender>
- <signal>toggled(bool)</signal>
- <receiver>groupBox_3</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel">
- <x>296</x>
- <y>102</y>
- </hint>
- <hint type="destinationlabel">
- <x>528</x>
- <y>122</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>mRadioButtonLowerThan</sender>
- <signal>toggled(bool)</signal>
- <receiver>mInputSequenceBox</receiver>
- <slot>setDisabled(bool)</slot>
- <hints>
- <hint type="sourcelabel">
- <x>269</x>
- <y>93</y>
- </hint>
- <hint type="destinationlabel">
- <x>214</x>
- <y>93</y>
- </hint>
- </hints>
- </connection>
- </connections>
+ <connections/>
</ui>
<rect>
<x>0</x>
<y>0</y>
- <width>615</width>
- <height>372</height>
+ <width>178</width>
+ <height>61</height>
</rect>
</property>
<property name="windowTitle">
Program: vv
Module: $RCSfile: vvMainWindow.cxx,v $
Language: C++
- Date: $Date: 2010/03/10 15:36:26 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2010/03/24 10:48:18 $
+ Version: $Revision: 1.17 $
Author : Pierre Seroul (pierre.seroul@gmail.com)
Copyright (C) 200COLUMN_IMAGE_NAME
{
if (mSlicerManagers.size() > 0)
{
- QString Extensions = "Dicom Files ( *.dcm)";
+ QString Extensions = "Dicom Files ( *.dcm; RS*)";
Extensions += ";;All Files (*)";
QString file = QFileDialog::getOpenFileName(this,tr("Merge Images"),mInputPathName,Extensions);
if (file.isNull())
Program: vv
Module: $RCSfile: vvToolBinarize.cxx,v $
Language: C++
- Date: $Date: 2010/03/17 11:22:18 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2010/03/24 10:48:18 $
+ Version: $Revision: 1.13 $
Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr)
Copyright (C) 2008
mFilter = new clitk::BinarizeImageGenericFilter<args_info_clitkBinarizeImage>;
// Set how many inputs are needed for this tool
- AddInputSelector(mFilter);
+ AddInputSelector("Select one image", mFilter);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolBinarize::reject() {
- DD("vvToolBinarize::reject");
+ // DD("vvToolBinarize::reject");
RemoveVTKObjects();
return vvToolWidgetBase::reject();
}
// Main filter
clitk::BinarizeImageGenericFilter<args_info_clitkBinarizeImage>::Pointer filter =
clitk::BinarizeImageGenericFilter<args_info_clitkBinarizeImage>::New();
- filter->SetArgsInfo(mArgsInfo);
filter->SetInputVVImage(mCurrentImage);
+ filter->SetArgsInfo(mArgsInfo);
+ filter->EnableReadOnDisk(false);
filter->Update();
// Output
Program: vv
Module: $RCSfile: vvToolBinarize.h,v $
Language: C++
- Date: $Date: 2010/03/17 11:22:18 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2010/03/24 10:48:18 $
+ Version: $Revision: 1.10 $
Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr)
Copyright (C) 2010
//-----------------------------------------------------
static void Initialize();
- void InputIsSet(bool b);
void GetArgsInfoFromGUI();
virtual void InputIsSelected(vvSlicerManager * m);
- // virtual void InputIsSelected(std::vector<vvSlicerManager *> & m);
//-----------------------------------------------------
public slots:
Program: vv
Module: $RCSfile: vvToolCropImage.cxx,v $
Language: C++
- Date: $Date: 2010/03/17 11:22:18 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2010/03/24 10:48:18 $
+ Version: $Revision: 1.5 $
Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr)
Copyright (C) 2008
Ui_vvToolCropImage::setupUi(mToolWidget);
// Set how many inputs are needed for this tool
- AddInputSelector();
+ AddInputSelector("Select one image");
}
//------------------------------------------------------------------------------
Program: vv
Module: $RCSfile: vvToolFooWithWidgetBase.cxx,v $
Language: C++
- Date: $Date: 2010/03/01 08:37:19 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2010/03/24 10:48:18 $
+ Version: $Revision: 1.2 $
Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr)
Copyright (C) 2010
//------------------------------------------------------------------------------
void vvToolFooWithWidgetBase::InputIsSelected(vvSlicerManager *m) {
- mButton->setText(m->GetFileName().c_str());
+
}
//------------------------------------------------------------------------------
Program: vv
Module: $RCSfile: vvToolFooWithWidgetBase.h,v $
Language: C++
- Date: $Date: 2010/03/01 08:37:19 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2010/03/24 10:48:18 $
+ Version: $Revision: 1.2 $
Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr)
Copyright (C) 2010
#define VVTOOLFOO_H
#include <QtDesigner/QDesignerExportWidget>
-#include <QDialog>
#include "vvToolBase.h"
#include "vvToolWidgetBase.h"
static void Initialize();
virtual void InputIsSelected(vvSlicerManager *m);
+ // OR ===> virtual void InputIsSelected(std::vector<vvSlicerManager *> & m);
public slots:
virtual void apply();
Program: vv
Module: $RCSfile: vvToolInputSelectorWidget.cxx,v $
Language: C++
- Date: $Date: 2010/03/17 11:22:18 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2010/03/24 10:48:18 $
+ Version: $Revision: 1.5 $
Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr)
Copyright (C) 2010
//------------------------------------------------------------------------------
-void vvToolInputSelectorWidget::AddInputSelector(const std::vector<vvSlicerManager*> & l, int index) {
- DD("ICICICICICICICIC AddInputSelector ADD layout");
- DD(index);
- DD(l.size());
+void vvToolInputSelectorWidget::AddInputSelector(QString & s,
+ const std::vector<vvSlicerManager*> & l,
+ int index,
+ bool allowSkip) {
+ // DD("ICICICICICICICIC AddInputSelector ADD layout");
+ // DD(index);
+ //DD(l.size());
vvToolSimpleInputSelectorWidget * input = new vvToolSimpleInputSelectorWidget;
mListOfSimpleInputWidget.push_back(input);
+ mSkipInput.push_back(false);
+
+ input->SetText(s);
+ input->EnableAllowSkip(allowSkip);
// copy list
std::vector<vvSlicerManager*> * ll = new std::vector<vvSlicerManager*>;
// Enable or disable
if (GetNumberOfInput() == 1) input->setEnabled(true);
else input->setEnabled(false);
- DD(GetNumberOfInput());
+ //DD(GetNumberOfInput());
// Connect signals & slots
connect(input, SIGNAL(accepted()), this, SLOT(accept()));
connect(input, SIGNAL(rejected()), this, SLOT(reject()));
+ connect(input, SIGNAL(sigskip()), this, SLOT(skip()));
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolInputSelectorWidget::accept() {
- DD("vvToolInputSelectorWidget::accept");
- DD(mNumberOfAcceptedInputs);
+ // DD("vvToolInputSelectorWidget::accept");
+ //DD(mNumberOfAcceptedInputs);
mNumberOfAcceptedInputs++;
if (mNumberOfAcceptedInputs == GetNumberOfInput()) {
setEnabled(false);
emit accepted();
}
else {
- DD("accepted");
+ //DD("accepted");
// for(unsigned int i=mNumberOfAcceptedInputs; i<mListOfSimpleInputWidget.size(); i++) {
- // mListOfSimpleInputWidget[i]->Initialize();
- mListOfSimpleInputWidget[mNumberOfAcceptedInputs]->setEnabled(true);
- //}
+ // mListOfSimpleInputWidget[i]->Initialize();
+ mListOfSimpleInputWidget[mNumberOfAcceptedInputs]->setEnabled(true);
+ //}
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolInputSelectorWidget::reject() {
- DD("vvToolInputSelectorWidget::reject");
+ // DD("vvToolInputSelectorWidget::reject");
if (mNumberOfAcceptedInputs != 0) {
// for(unsigned int i=mNumberOfAcceptedInputs; i<mListOfSimpleInputWidget.size(); i++) {
// mListOfSimpleInputWidget[i]->Initialize();
- DD(mNumberOfAcceptedInputs);
+ // DD(mNumberOfAcceptedInputs);
mListOfSimpleInputWidget[mNumberOfAcceptedInputs]->setEnabled(false);
mListOfSimpleInputWidget[mNumberOfAcceptedInputs-1]->setEnabled(true);
mNumberOfAcceptedInputs--;
//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+void vvToolInputSelectorWidget::skip() {
+ DD("SKIP");
+ mSkipInput[mNumberOfAcceptedInputs] = true;
+ accept();//mNumberOfAcceptedInputs++;
+}
+//------------------------------------------------------------------------------
+
+
//------------------------------------------------------------------------------
std::vector<vvSlicerManager*> & vvToolInputSelectorWidget::GetSelectedInputs() {
std::vector<vvSlicerManager*> * l = new std::vector<vvSlicerManager*>;
- for(unsigned int i=0; i<mListOfSimpleInputWidget.size(); i++)
- l->push_back(mListOfSimpleInputWidget[i]->GetSelectedInput());
+ for(unsigned int i=0; i<mListOfSimpleInputWidget.size(); i++) {
+ if (!mSkipInput[i])
+ l->push_back(mListOfSimpleInputWidget[i]->GetSelectedInput());
+ }
return *l;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolInputSelectorWidget::AnImageIsBeingClosed(vvSlicerManager * m) {
- DD("TODO : verify that the image still exist !!");
+ // DD("TODO : verify that the image still exist !!");
// for(int i=0; i<
}
//------------------------------------------------------------------------------
Program: vv
Module: $RCSfile: vvToolInputSelectorWidget.h,v $
Language: C++
- Date: $Date: 2010/03/17 11:22:18 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2010/03/24 10:48:18 $
+ Version: $Revision: 1.6 $
Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr)
Copyright (C) 2010
vvToolInputSelectorWidget(QWidget * parent=0, Qt::WindowFlags f=0);
~vvToolInputSelectorWidget() {}
- void AddInputSelector(const std::vector<vvSlicerManager*> & l, int index);
+ void AddInputSelector(QString & s, const std::vector<vvSlicerManager*> & l, int index, bool allowSkip=false);
void Initialize();
std::vector<vvSlicerManager*> & GetSelectedInputs();
void AnImageIsBeingClosed(vvSlicerManager * m);
public slots:
void accept(); // to change ! in something like acceptOneMoreInput
void reject();
+ void skip();
signals:
void accepted();
vvSlicerManager * mCurrentSliceManager;
int mNumberOfAcceptedInputs;
std::vector<vvToolSimpleInputSelectorWidget *> mListOfSimpleInputWidget;
+ std::vector<bool> mSkipInput;
}; // end class vvToolInputSelectorWidget
//------------------------------------------------------------------------------
Program: vv
Module: $RCSfile: vvToolSimpleInputSelectorWidget.cxx,v $
Language: C++
- Date: $Date: 2010/03/17 11:23:46 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2010/03/24 10:48:18 $
+ Version: $Revision: 1.2 $
Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr)
Copyright (C) 2010
#include "vvToolSimpleInputSelectorWidget.h"
#include "vvSlicerManager.h"
+#include <QAbstractButton>
//------------------------------------------------------------------------------
vvToolSimpleInputSelectorWidget::vvToolSimpleInputSelectorWidget(QWidget * parent, Qt::WindowFlags f):
connect(mInputSelectionButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(mInputSelectionButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(mInputSequenceBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changeInput(int)));
- DD("vvToolSimpleInputSelectorWidget::Initialize");
- DD(mSlicerManagerList.size());
+ changeInput(0);
if (mSlicerManagerList.size() == 1) {
- DD("Initialize::accept");
- accept();
+ if (!mAllowSkip) accept();
}
}
//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+void vvToolSimpleInputSelectorWidget::SetText(QString & s) {
+ mGroupBox->setTitle(s);
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolSimpleInputSelectorWidget::EnableAllowSkip(bool b) {
+ mAllowSkip = b;
+ if (mAllowSkip) {
+ mInputSelectionButtonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Discard);
+ connect(mInputSelectionButtonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(skip(QAbstractButton*)));
+ }
+ else
+ mInputSelectionButtonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
+}
+//------------------------------------------------------------------------------
+
+
//------------------------------------------------------------------------------
void vvToolSimpleInputSelectorWidget::SetInputList(const std::vector<vvSlicerManager*> & l, int index) {
- DD("vvToolSimpleInputSelectorWidget::SetInputList");
- DD(index);
mInputSequenceBox->clear();
for(unsigned int i=0; i<l.size(); i++)
mSlicerManagerList.push_back(l[i]);
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvToolSimpleInputSelectorWidget::reject() {
- DD("vvToolSimpleInputSelectorWidget::reject()");
emit rejected();
}
//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+void vvToolSimpleInputSelectorWidget::skip(QAbstractButton* b) {
+ if (b->text() == "Discard") emit sigskip();
+}
+//------------------------------------------------------------------------------
+
+
//------------------------------------------------------------------------------
void vvToolSimpleInputSelectorWidget::changeInput(int index) {
- DD("changeInput");
- DD(index);
if (index<0) return;
mCurrentIndex = index;
vvImage * mCurrentImage = mSlicerManagerList[index]->GetImage();
Program: vv
Module: $RCSfile: vvToolSimpleInputSelectorWidget.h,v $
Language: C++
- Date: $Date: 2010/03/17 11:23:45 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2010/03/24 10:48:18 $
+ Version: $Revision: 1.2 $
Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr)
Copyright (C) 2010
void Initialize();
int GetSelectedInputIndex() { return mCurrentIndex; }
vvSlicerManager * GetSelectedInput();
+ void SetText(QString & s);
+ void EnableAllowSkip(bool b);
public slots:
void accept();
void reject();
void setEnabled(bool b);
+ void skip(QAbstractButton*);
signals:
void accepted();
void rejected();
+ void sigskip();
protected slots:
void changeInput(int i);
std::vector<vvSlicerManager*> mSlicerManagerList;
int mCurrentIndex;
vvSlicerManager * mCurrentSliceManager;
+ bool mAllowSkip;
}; // end class vvToolSimpleInputSelectorWidget
//------------------------------------------------------------------------------
Program: vv
Module: $RCSfile: vvToolWidgetBase.cxx,v $
Language: C++
- Date: $Date: 2010/03/17 11:22:18 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2010/03/24 10:48:18 $
+ Version: $Revision: 1.4 $
Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr)
Copyright (C) 2008
#include "vvToolWidgetBase.h"
#include "vvMainWindowBase.h"
#include "vvSlicerManager.h"
+#include <QMessageBox>
//------------------------------------------------------------------------------
vvToolWidgetBase::vvToolWidgetBase(vvMainWindowBase * parent, Qt::WindowFlags f)
//------------------------------------------------------------------------------
-void vvToolWidgetBase::AddInputSelector(clitk::ImageToImageGenericFilterBase * f) {
- DD("AddInputSelector with filter");
- DD(mMainWindowBase->GetSlicerManagers().size());
+void vvToolWidgetBase::AddInputSelector(QString s, clitk::ImageToImageGenericFilterBase * f, bool allowSkip) {
+ // DD("AddInputSelector with filter");
+ // DD(mMainWindowBase->GetSlicerManagers().size());
int j=0;
mFilter = f;
mSlicerManagersCompatible.clear();
// mToolInputSelectionWidget->setToolTip(QString("%1").arg(mFilter->GetAvailableImageTypes().c_str()));
for(unsigned int i=0; i<mMainWindowBase->GetSlicerManagers().size(); i++) {
- DD(i);
+ // DD(i);
vvImage * s = mMainWindowBase->GetSlicerManagers()[i]->GetImage();
if (mFilter->CheckImageType(s->GetNumberOfDimensions(),
s->GetNumberOfScalarComponents(),
j++;
}
}
- mToolInputSelectionWidget->AddInputSelector(mSlicerManagersCompatible, mCurrentCompatibleIndex);
+ if (mSlicerManagersCompatible.size() == 0) {
+ QMessageBox::information(this, "No image","Sorry, could not perform operation. No compatible opened image type.");
+ close();
+ return;
+ }
+ mToolInputSelectionWidget->AddInputSelector(s, mSlicerManagersCompatible, mCurrentCompatibleIndex, allowSkip);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-void vvToolWidgetBase::AddInputSelector() {
- DD("AddInput without filter");
- DD(mMainWindowBase->GetSlicerManagers().size());
+void vvToolWidgetBase::AddInputSelector(QString s, bool allowSkip) {
+ // DD("AddInput without filter");
+ // DD(mMainWindowBase->GetSlicerManagers().size());
mSlicerManagersCompatible.clear();
for(unsigned int i=0; i<mMainWindowBase->GetSlicerManagers().size(); i++) {
mSlicerManagersCompatible.push_back(mMainWindowBase->GetSlicerManagers()[i]);
}
- mToolInputSelectionWidget->AddInputSelector(mMainWindowBase->GetSlicerManagers(),
- mMainWindowBase->GetSlicerManagerCurrentIndex());
+ if (mMainWindowBase->GetSlicerManagers().size() == 0) {
+ QMessageBox::information(this, "No image","Sorry, could not perform operation. No opened image type.");
+ close();
+ return;
+ }
+ mToolInputSelectionWidget->AddInputSelector(s, mMainWindowBase->GetSlicerManagers(),
+ mMainWindowBase->GetSlicerManagerCurrentIndex(), allowSkip);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolWidgetBase::show() {
- if (!mIsInitialized) {
- DD("show -> init");
- mToolInputSelectionWidget->Initialize();
- mIsInitialized = true;
- }
- QDialog::show();
+ if (!mIsInitialized) {
+ // DD("show -> init");
+ mToolInputSelectionWidget->Initialize();
+ mIsInitialized = true;
+ }
+ QDialog::show();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool vvToolWidgetBase::close() {
- DD("vvToolWidgetBase::close()");
+ // DD("vvToolWidgetBase::close()");
return QDialog::close();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolWidgetBase::AnImageIsBeingClosed(vvSlicerManager * m) {
- mToolInputSelectionWidget->AnImageIsBeingClosed(m);
+ mToolInputSelectionWidget->AnImageIsBeingClosed(m);
if (m == mCurrentSlicerManager) {
close();
}
//------------------------------------------------------------------------------
void vvToolWidgetBase::InitializeInputs() {
/*
- if (mFilter) {
+ if (mFilter) {
int j=0;
mToolInputSelectionWidget->setToolTip(QString("%1").arg(mFilter->GetAvailableImageTypes().c_str()));
for(unsigned int i=0; i<mMainWindowBase->GetSlicerManagers().size(); i++) {
- vvImage * s = mMainWindowBase->GetSlicerManagers()[i]->GetImage();
- if (mFilter->CheckImageType(s->GetNumberOfDimensions(),
- s->GetNumberOfScalarComponents(),
- s->GetScalarTypeAsString())) {
- mSlicerManagersCompatible.push_back(mMainWindowBase->GetSlicerManagers()[i]);
- if ((int)i == mMainWindowBase->GetSlicerManagerCurrentIndex()) mCurrentCompatibleIndex = j;
- j++;
- }
+ vvImage * s = mMainWindowBase->GetSlicerManagers()[i]->GetImage();
+ if (mFilter->CheckImageType(s->GetNumberOfDimensions(),
+ s->GetNumberOfScalarComponents(),
+ s->GetScalarTypeAsString())) {
+ mSlicerManagersCompatible.push_back(mMainWindowBase->GetSlicerManagers()[i]);
+ if ((int)i == mMainWindowBase->GetSlicerManagerCurrentIndex()) mCurrentCompatibleIndex = j;
+ j++;
}
- }
- else {
+ }
+ }
+ else {
mSlicerManagersCompatible = mMainWindowBase->GetSlicerManagers();
mCurrentCompatibleIndex = mMainWindowBase->GetSlicerManagerCurrentIndex();
- }
- mToolInputSelectionWidget->Initialize(mSlicerManagersCompatible,
- mCurrentCompatibleIndex);
- mIsInitialized = true;
+ }
+ mToolInputSelectionWidget->Initialize(mSlicerManagersCompatible,
+ mCurrentCompatibleIndex);
+ mIsInitialized = true;
*/
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolWidgetBase::InputIsSelected() {
- DD("InputIsSelected");
+ // DD("InputIsSelected");
buttonBox->setEnabled(true);
std::vector<vvSlicerManager*> & l = mToolInputSelectionWidget->GetSelectedInputs();
mCurrentSlicerManager = l[0];
//------------------------------------------------------------------------------
void vvToolWidgetBase::InputIsSelected(std::vector<vvSlicerManager*> & l) {
buttonBox->setEnabled(true);
- DD("InputIsSelected(vector)");
- DD(l.size());
+ // DD("InputIsSelected(vector)");
+ // DD(l.size());
if (l.size() == 1) InputIsSelected(l[0]);
else {
- std::cerr << "You MUST overwrite this method vvToolWidgetBase::InputIsSelected(vector<vvSlicerManager *> m) if you use several input" << std::endl;
- exit(0);
+ std::cerr << "You MUST overwrite this method vvToolWidgetBase::InputIsSelected(vector<vvSlicerManager *> m) if you use several input" << std::endl;
+ exit(0);
}
}
//------------------------------------------------------------------------------
Program: vv
Module: $RCSfile: vvToolWidgetBase.h,v $
Language: C++
- Date: $Date: 2010/03/17 11:22:18 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2010/03/24 10:48:18 $
+ Version: $Revision: 1.4 $
Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr)
Copyright (C) 2010
virtual void InputIsSelected(vvSlicerManager *m);
virtual void InputIsSelected(std::vector<vvSlicerManager*> & l);
- void AddInputSelector(clitk::ImageToImageGenericFilterBase * f);
- void AddInputSelector();
+ void AddInputSelector(QString s, clitk::ImageToImageGenericFilterBase * f, bool allowSkip=false);
+ void AddInputSelector(QString s, bool allowSkip=false);
public slots:
virtual void apply() = 0;