Authors belong to:
- University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://oncora1.lyon.fnclcc.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
- BSD See included LICENSE.txt file
- CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
- ======================================================================-====*/
+ ===========================================================================**/
#ifndef CLITKCROPLIKEIMAGEFILTER_TXX
#define CLITKCROPLIKEIMAGEFILTER_TXX
// clitk
#include "clitkCommon.h"
+#include "clitkPasteImageFilter.h"
// itk
-#include "itkPasteImageFilter.h"
+//#include "itkPasteImageFilter.h"
//--------------------------------------------------------------------
template <class ImageType>
<< ") of 'like' is " << likeSpacing[i] << ".");
}
}
+
+ // Check that we must crop along each dimension. If not, we use the
+ // size of the input image
+ for(unsigned int i=0; i<ImageType::ImageDimension; i++) {
+ if (m_CropAlongThisDimension[i] == false) {
+ likeStart[i] = input->GetLargestPossibleRegion().GetIndex()[i];
+ likeSize[i] = input->GetLargestPossibleRegion().GetSize()[i];
+ }
+ }
+
// Define output region
m_OutputRegion.SetIndex(likeStart);
m_OutputRegion.SetSize(likeSize);
output->FillBuffer(GetBackgroundValue());
// Paste image inside
- typedef itk::PasteImageFilter<ImageType,ImageType> PasteFilterType;
+ typedef clitk::PasteImageFilter<ImageType,ImageType> PasteFilterType;
typename PasteFilterType::Pointer pasteFilter = PasteFilterType::New();
//pasteFilter->ReleaseDataFlagOn(); // change nothing ?
// pasteFilter->InPlaceOn(); // makt it seg fault