diff --git a/Modules/Core/Streaming/include/otbStreamingImageRAMWriter.h b/Modules/Core/Streaming/include/otbStreamingImageRAMWriter.h deleted file mode 100644 index c19b2084698596298626d1b0e1adacea05706272..0000000000000000000000000000000000000000 --- a/Modules/Core/Streaming/include/otbStreamingImageRAMWriter.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef otbStreamingImageRAMWriter_h -#define otbStreamingImageRAMWriter_h - -#include "itkMacro.h" -#include "itkImageToImageFilter.h" -#include "itkImageBase.h" - -namespace otb -{ - -template <class TInputImage > -class ITK_EXPORT StreamingImageRAMWriter -: public itk::ImageToImageFilter<TInputImage, TInputImage> -{ -public: - - typedef StreamingImageRAMWriter Self; - typedef itk::ImageToImageFilter<TInputImage, TInputImage> Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; - - typedef typename TInputImage::RegionType OutputImageRegionType; - - itkNewMacro(Self); - - itkTypeMacro(StreamingImageRAMWriter, itk::ImageToImageFilter); - -protected: - - StreamingImageRAMWriter(){}; - - ~StreamingImageRAMWriter() ITK_OVERRIDE {}; - - void AllocateOutputs(); - - void GenerateOutputInformation(); - - void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, - itk::ThreadIdType threadId); - -private: - - StreamingImageRAMWriter(const Self &); //purposely not implemented - void operator = (const Self&); //purposely not implemented - - - -}; - - - - -} // end namespace otb - -#ifndef OTB_MANUAL_INSTANTIATION -#include "otbStreamingImageRAMWriter.txx" -#endif - -#endif \ No newline at end of file diff --git a/Modules/Core/Streaming/include/otbStreamingImageRAMWriter.txx b/Modules/Core/Streaming/include/otbStreamingImageRAMWriter.txx deleted file mode 100644 index d2f79d8095fec21194db862654e602b7bb3b8a17..0000000000000000000000000000000000000000 --- a/Modules/Core/Streaming/include/otbStreamingImageRAMWriter.txx +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef otbStreamingImageRAMWriter_txx -#define otbStreamingImageRAMWriter_txx -#include "otbStreamingImageRAMWriter.h" - -#include "itkOutputDataObjectIterator.h" - - -namespace otb -{ -template< typename TInputImage > -void StreamingImageRAMWriter < TInputImage > -::AllocateOutputs() -{ - typedef itk::ImageBase< 2 > ImageBaseType; - typename ImageBaseType::Pointer outputPtr; - - // Allocate the output memory - for ( itk::OutputDataObjectIterator it(this); !it.IsAtEnd(); it++ ) - { - // Check whether the output is an image of the appropriate - // dimension (use ProcessObject's version of the GetInput() - // method since it returns the input as a pointer to a - // DataObject as opposed to the subclass version which - // static_casts the input to an TInputImage). - outputPtr = dynamic_cast< ImageBaseType * >( it.GetOutput() ); - - if ( outputPtr && - !outputPtr->GetRequestedRegion().IsInside(outputPtr->GetBufferedRegion() ) ) - { - outputPtr->SetBufferedRegion( outputPtr->GetRequestedRegion() ); - outputPtr->Allocate(); - } - } -} - -template< typename TInputImage > -void StreamingImageRAMWriter < TInputImage > -::GenerateOutputInformation() -{ - Superclass::GenerateOutputInformation(); - typename TInputImage::ConstPointer input = this->GetInput(); - typename TInputImage::Pointer output = this->GetOutput(); - - if ( !input || !output ) - { - return; - } - output->SetLargestPossibleRegion( input->GetLargestPossibleRegion() ); - output->SetBufferedRegion( input->GetLargestPossibleRegion() ); - output->SetRequestedRegion( input->GetRequestedRegion() ); - std::cout<<"Ram writer output Largest :"<<output->GetLargestPossibleRegion().GetSize()<<std::endl; - std::cout<<"Ram writer output Requested :"<<output->GetRequestedRegion().GetSize()<<std::endl; - output->Allocate(); -} - -template< typename TInputImage > -void StreamingImageRAMWriter < TInputImage > -::ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, - itk::ThreadIdType itkNotUsed( threadId ) ) -{ - typename TInputImage::ConstPointer input = this->GetInput(); - typename TInputImage::Pointer output = this->GetOutput(); - - itk::ImageRegionConstIterator < TInputImage > it ( input , - outputRegionForThread ); - itk::ImageRegionIterator < TInputImage > oit ( output , - outputRegionForThread ); - it.GoToBegin(); - oit.GoToBegin(); - while( !it.IsAtEnd() ) - { - oit.Set( it.Get() ); - ++oit; - ++it; - } -} - - -} // end namespace otb - -#endif \ No newline at end of file