24 #if defined(__GNUC__) || defined(__clang__)
25 #pragma GCC diagnostic push
26 #pragma GCC diagnostic ignored "-Wunused-parameter"
28 #pragma GCC diagnostic pop
34 #include "OTBImageBaseExport.h"
40 template <
class ImageType>
43 typename ImageType::SpacingType spacing = input->GetSpacing();
44 typename ImageType::DirectionType direction = input->GetDirection();
45 for (
unsigned int i = 0; i < ImageType::ImageDimension; i++)
47 spacing[i] *= direction[i][i];
52 template <
class InputImage,
typename SpacingType>
56 typename InputImage::DirectionType direction = input->GetDirection();
57 for (
unsigned int i = 0; i < InputImage::ImageDimension; i++)
62 if (direction[i][i] > 0)
64 for (
unsigned int j = 0; j < InputImage::ImageDimension; j++)
66 direction[j][i] = -direction[j][i];
69 spacing[i] = -spacing[i];
72 input->SetDirection(direction);
73 input->SetSpacing(spacing);
88 template <
class TPixel,
unsigned int VImageDimension = 2>
89 class OTBImageBase_EXPORT_TEMPLATE
Image
90 :
public itk::Image<TPixel, VImageDimension>
111 typedef typename Superclass::PixelType
PixelType;
136 itkStaticConstMacro(ImageDimension,
unsigned int, VImageDimension);
197 virtual VectorType GetGeoTransform(
void)
const;
224 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;
227 void CopyInformation(
const itk::DataObject*)
override;
236 Image(
const Self&) =
delete;
237 void operator=(
const Self&) =
delete;
242 #ifndef OTB_MANUAL_INSTANTIATION
254 extern template class OTBImageBase_EXPORT_TEMPLATE
Image<int, 2>;
256 extern template class OTBImageBase_EXPORT_TEMPLATE
Image<char, 2>;
261 extern template class OTBImageBase_EXPORT_TEMPLATE Image<std::complex<int>, 2>;
262 extern template class OTBImageBase_EXPORT_TEMPLATE Image<std::complex<short>, 2>;
263 extern template class OTBImageBase_EXPORT_TEMPLATE Image<std::complex<float>, 2>;
264 extern template class OTBImageBase_EXPORT_TEMPLATE Image<std::complex<double>, 2>;