X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=itk%2FclitkExtractSliceFilter.txx;h=af008ec3e9379e6d8f60bfd8cc51123285e26a64;hb=20147f097d36f54eae548368df24f577e5567677;hp=594fa106f4ea2397ddab19b1cad25db2cc301642;hpb=38786c4da19b87319bbe3cecc145e3d1771d10da;p=clitk.git diff --git a/itk/clitkExtractSliceFilter.txx b/itk/clitkExtractSliceFilter.txx index 594fa10..af008ec 100644 --- a/itk/clitkExtractSliceFilter.txx +++ b/itk/clitkExtractSliceFilter.txx @@ -3,7 +3,7 @@ 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 @@ -14,7 +14,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html - ======================================================================-====*/ + ===========================================================================**/ // clitk #include "clitkCommon.h" @@ -53,11 +53,9 @@ void clitk::ExtractSliceFilter:: GetOutputSlices(std::vector & o) { - DD("GetOutputSlices"); o.clear(); for(unsigned int i=0; iGetNumberOfOutputs(); i++) { o.push_back(this->GetOutput(i)); - // writeImage(this->GetOutput(i), "extractB"+clitk::toString(i)+".mhd"); } } //-------------------------------------------------------------------- @@ -69,7 +67,6 @@ void clitk::ExtractSliceFilter:: GenerateOutputInformation() { - DD("GenerateOutputInformation"); ImagePointer input = dynamic_cast(itk::ProcessObject::GetInput(0)); // Create region to extract @@ -77,7 +74,6 @@ GenerateOutputInformation() m_size = m_region.GetSize(); m_index = m_region.GetIndex(); m_NumberOfSlices = m_region.GetSize()[GetDirection()]; - DD(m_NumberOfSlices); } //-------------------------------------------------------------------- @@ -87,7 +83,6 @@ template void clitk::ExtractSliceFilter:: GenerateInputRequestedRegion() { - DD("GenerateInputRequestedRegion"); // Call default Superclass::GenerateInputRequestedRegion(); // Get input pointers and set requested region to common region @@ -101,8 +96,6 @@ template void clitk::ExtractSliceFilter:: GenerateData() { - DD("GenerateData"); - //-------------------------------------------------------------------- // Get input pointer input = dynamic_cast(itk::ProcessObject::GetInput(0)); @@ -112,24 +105,7 @@ GenerateData() { m_size[GetDirection()] = 0; m_region.SetSize(m_size); int start = m_index[GetDirection()]; - DD(start); - this->SetNumberOfOutputs(m_NumberOfSlices); - /* - typename SliceType::RegionType regionSlice; - typename SliceType::SizeType sizeSlice; - typename SliceType::IndexType indexSlice; - int j=0; - for(int i=0; iSetNumberOfIndexedInputs(m_NumberOfSlices); //-------------------------------------------------------------------- // loop ExtractImageFilter with region updated, push_back @@ -139,17 +115,13 @@ GenerateData() { for(int i=0; iSetInput(input); - // DD(i); m_index[GetDirection()] = start + i; m_region.SetIndex(m_index); - // DD(m_region); extract->SetExtractionRegion(m_region); + extract->SetDirectionCollapseToSubmatrix(); extract->Update(); - // DD("set output"); - SetNthOutput(i, extract->GetOutput()); - // writeImage(extract->GetOutput(), "extractA"+clitk::toString(i)+".mhd"); + this->SetNthOutput(i, extract->GetOutput()); } - return; } //--------------------------------------------------------------------