22 #ifndef otbImageFileWriter_h
23 #define otbImageFileWriter_h
26 #include "itkProcessObject.h"
31 #include "OTBImageIOExport.h"
65 template <
class TInputImage>
97 itkStaticConstMacro(InputImageDimension,
unsigned int, InputImageType::ImageDimension);
107 return m_StreamingManager;
114 m_StreamingManager = streamingManager;
119 void SetNumberOfDivisionsStrippedStreaming(
unsigned int nbDivisions);
123 void SetNumberOfDivisionsTiledStreaming(
unsigned int nbDivisions);
128 void SetNumberOfLinesStrippedStreaming(
unsigned int nbLinesPerStrip);
139 void SetAutomaticStrippedStreaming(
unsigned int availableRAM = 0,
double bias = 1.0);
143 void SetTileDimensionTiledStreaming(
unsigned int tileDimension);
155 void SetAutomaticTiledStreaming(
unsigned int availableRAM = 0,
double bias = 1.0);
163 void SetAutomaticAdaptativeStreaming(
unsigned int availableRAM = 0,
double bias = 1.0);
166 using Superclass::SetInput;
167 virtual void SetInput(
const InputImageType* input);
170 const InputImageType* GetInput();
174 void Update()
override;
176 virtual void SetFileName(
const std::string& extendedFileName);
178 virtual const char* GetFileName()
const;
182 void SetIORegion(
const itk::ImageIORegion& region);
183 itkGetConstReferenceMacro(IORegion, itk::ImageIORegion);
187 itkSetMacro(UseCompression,
bool);
188 itkGetConstReferenceMacro(UseCompression,
bool);
189 itkBooleanMacro(UseCompression);
198 itkSetMacro(UseInputMetaDataDictionary,
bool);
199 itkGetConstReferenceMacro(UseInputMetaDataDictionary,
bool);
200 itkBooleanMacro(UseInputMetaDataDictionary);
210 const bool& GetAbortGenerateData()
const override;
212 void SetAbortGenerateData(
const bool val)
override;
217 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;
220 void GenerateData(
void)
override;
223 void GenerateOutputInformation(
void)
override;
231 if (
typeid(event) !=
typeid(itk::ProgressEvent))
236 itk::ProcessObject* processObject =
dynamic_cast<itk::ProcessObject*
>(object);
239 m_DivisionProgress = processObject->GetProgress();
242 this->UpdateFilterProgress();
247 this->UpdateProgress((m_DivisionProgress + m_CurrentDivision) / m_NumberOfDivisions);
295 #ifndef OTB_MANUAL_INSTANTIATION
308 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<unsigned int, 2>>;
309 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<int, 2>>;
310 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<unsigned char, 2>>;
311 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<char, 2>>;
312 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<unsigned short, 2>>;
313 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<short, 2>>;
314 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<float, 2>>;
315 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<double, 2>>;
316 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<std::complex<int>, 2>>;
317 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<std::complex<short>, 2>>;
318 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<std::complex<float>, 2>>;
319 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<std::complex<double>, 2>>;
320 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<unsigned int, 2>>;
321 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<int, 2>>;
322 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<unsigned char, 2>>;
323 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<char, 2>>;
324 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<unsigned short, 2>>;
325 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<short, 2>>;
326 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<float, 2>>;
327 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<double, 2>>;
328 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<std::complex<int>, 2>>;
329 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<std::complex<short>, 2>>;
330 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<std::complex<float>, 2>>;
331 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<std::complex<double>, 2>>;
Converts an extended filename to writer options.
itk::SmartPointer< Self > Pointer
Writes image data to a single file with streaming process.
StreamingManager< InputImageType > StreamingManagerType
unsigned int m_NumberOfDivisions
bool m_UserSpecifiedIORegion
bool m_FactorySpecifiedImageIO
void UpdateFilterProgress()
InputImageType::PixelType InputImagePixelType
itk::SmartPointer< Self > Pointer
ImageFileWriter(const ImageFileWriter &)=delete
void operator=(const ImageFileWriter &)=delete
void SetStreamingManager(StreamingManagerType *streamingManager)
TInputImage InputImageType
ExtendedFilenameToWriterOptions FNameHelperType
unsigned int m_CurrentDivision
InputImageType::IndexType InputIndexType
InputImageType::RegionType InputImageRegionType
unsigned long m_ObserverID
StreamingManagerType * GetStreamingManager(void)
bool m_UseInputMetaDataDictionary
itk::ImageIORegion m_IORegion
itkGetObjectMacro(ImageIO, otb::ImageIOBase)
itk::ProcessObject Superclass
InputImageType::Pointer InputImagePointer
Superclass::DataObjectPointer DataObjectPointer
InputIndexType m_ShiftOutputIndex
StreamingManagerPointerType m_StreamingManager
itk::SmartPointer< const Self > ConstPointer
FNameHelperType::Pointer m_FilenameHelper
otb::ImageIOBase::Pointer m_ImageIO
OutputImageType::RegionType OutputImageRegionType
OutputImageType::PixelType OutputImagePixelType
std::vector< unsigned int > m_BandList
OutputImageType::Pointer OutputImagePointer
TInputImage OutputImageType
unsigned int m_IOComponents
StreamingManagerType::Pointer StreamingManagerPointerType
bool m_UserSpecifiedImageIO
void ObserveSourceFilterProgress(itk::Object *object, const itk::EventObject &event)
Abstract superclass defines image IO interface.
itk::SmartPointer< Self > Pointer
This class handles the streaming process used in the writers implementation.
itk::SmartPointer< Self > Pointer
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.