1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ======================================================================-====*/
20 #include "clitkCommon.h"
23 //--------------------------------------------------------------------
24 template <class ImageType>
25 clitk::ExtractSliceFilter<ImageType>::
28 itk::ImageToImageFilter<ImageType, ImageType>()
30 this->SetNumberOfRequiredInputs(1);
33 //--------------------------------------------------------------------
36 //--------------------------------------------------------------------
37 template <class ImageType>
39 clitk::ExtractSliceFilter<ImageType>::
40 SetInput(const ImageType * image) {
41 // Process object is not const-correct so the const casting is required.
42 this->SetNthInput(0, const_cast<ImageType *>(image));
44 //--------------------------------------------------------------------
47 //--------------------------------------------------------------------
48 template <class ImageType>
50 clitk::ExtractSliceFilter<ImageType>::
51 GenerateOutputInformation() {
52 DD("GenerateOutputInformation");
53 ImagePointer input = dynamic_cast<ImageType*>(itk::ProcessObject::GetInput(0));
54 // ImagePointer outputImage = this->GetOutput(0);
55 // outputImage->SetRegions(input->GetLargestPossibleRegion());
57 output = this->GetOutput(0);
60 typename SliceType::RegionType SliceRegionType;
61 typename SliceType::SizeType SliceSizeType;
62 typename SliceType::IndexType SliceIndexType;
63 // SliceRegionType region;
66 // loop ExtractImageFilter with region updated, push_back
70 //--------------------------------------------------------------------
73 //--------------------------------------------------------------------
74 template <class ImageType>
76 clitk::ExtractSliceFilter<ImageType>::
77 GenerateInputRequestedRegion() {
78 DD("GenerateInputRequestedRegion");
80 itk::ImageToImageFilter<ImageType, ImageType>::GenerateInputRequestedRegion();
81 // Get input pointers and set requested region to common region
82 ImagePointer input = dynamic_cast<ImageType*>(itk::ProcessObject::GetInput(0));
83 input->SetRequestedRegion(input->GetLargestPossibleRegion());
85 //--------------------------------------------------------------------
87 //--------------------------------------------------------------------
88 template <class ImageType>
90 clitk::ExtractSliceFilter<ImageType>::
95 input = dynamic_cast<ImageType*>(itk::ProcessObject::GetInput(0));
99 //--------------------------------------------------------------------
100 //--------------------------------------------------------------------
101 // Final Step -> set output
102 //this->SetNthOutput(0, working_image);
105 //--------------------------------------------------------------------