/*========================================================================= 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 ======================================================================-====*/ // clitk #include "clitkCommon.h" //-------------------------------------------------------------------- template clitk::ExtractSliceFilter:: ExtractSliceFilter(): clitk::FilterBase(), itk::ImageToImageFilter() { this->SetNumberOfRequiredInputs(1); SetDirection(2); } //-------------------------------------------------------------------- //-------------------------------------------------------------------- template void clitk::ExtractSliceFilter:: SetInput(const ImageType * image) { // Process object is not const-correct so the const casting is required. this->SetNthInput(0, const_cast(image)); } //-------------------------------------------------------------------- //-------------------------------------------------------------------- template void clitk::ExtractSliceFilter:: GenerateOutputInformation() { DD("GenerateOutputInformation"); ImagePointer input = dynamic_cast(itk::ProcessObject::GetInput(0)); // ImagePointer outputImage = this->GetOutput(0); // outputImage->SetRegions(input->GetLargestPossibleRegion()); output = this->GetOutput(0); // create vector typename SliceType::RegionType SliceRegionType; typename SliceType::SizeType SliceSizeType; typename SliceType::IndexType SliceIndexType; // SliceRegionType region; // create region // loop ExtractImageFilter with region updated, push_back } //-------------------------------------------------------------------- //-------------------------------------------------------------------- template void clitk::ExtractSliceFilter:: GenerateInputRequestedRegion() { DD("GenerateInputRequestedRegion"); // Call default itk::ImageToImageFilter::GenerateInputRequestedRegion(); // Get input pointers and set requested region to common region ImagePointer input = dynamic_cast(itk::ProcessObject::GetInput(0)); input->SetRequestedRegion(input->GetLargestPossibleRegion()); } //-------------------------------------------------------------------- //-------------------------------------------------------------------- template void clitk::ExtractSliceFilter:: GenerateData() { DD("GenerateData"); // Get input pointer input = dynamic_cast(itk::ProcessObject::GetInput(0)); //-------------------------------------------------------------------- //-------------------------------------------------------------------- // Final Step -> set output //this->SetNthOutput(0, working_image); return; } //--------------------------------------------------------------------