From f9fa79602f00a984ca6a524a8810d987c25fa2b9 Mon Sep 17 00:00:00 2001 From: Thomas Feuvrier <thomas.feuvrier@c-s.fr> Date: Tue, 7 Feb 2006 08:23:40 +0000 Subject: [PATCH] nomsg --- Code/Common/otbExtractROI.h | 6 +- Code/Common/otbExtractROIBase.h | 7 +- Code/Common/otbMultiChannelExtractROI.h | 11 ++- Code/Common/otbVectorToRGBImageFilter.h | 83 -------------------- Code/Common/otbVectorToRGBImageFilter.txx | 67 ---------------- Code/Common/otbVectorToScalarImageFilter.h | 69 ---------------- Code/Common/otbVectorToScalarImageFilter.txx | 63 --------------- 7 files changed, 18 insertions(+), 288 deletions(-) delete mode 100755 Code/Common/otbVectorToRGBImageFilter.h delete mode 100755 Code/Common/otbVectorToRGBImageFilter.txx delete mode 100755 Code/Common/otbVectorToScalarImageFilter.h delete mode 100755 Code/Common/otbVectorToScalarImageFilter.txx diff --git a/Code/Common/otbExtractROI.h b/Code/Common/otbExtractROI.h index 8640e4609e..dc3d3063f5 100755 --- a/Code/Common/otbExtractROI.h +++ b/Code/Common/otbExtractROI.h @@ -20,9 +20,11 @@ namespace otb { /** \class ExtractROI - * \brief Extrait une partie d'une image (mono-canal ou multi-canal). + * \brief Extrait une partie d'une image mono-canal. + * * Le Pixel peut etre de type simple ou alors un itk::RGBPixel, etc. - * Cette classe s'appuie sur la classe "otb::ExtractROIBase" + * \note Ces classe est paramétrée par le type de pixel des images d'entrée et de sortie. Les images manipulées dans cette classe + * sont de type "itk::Image". * */ template <class TInputPixel, class TOutputPixel,unsigned int VImageDimension=2> diff --git a/Code/Common/otbExtractROIBase.h b/Code/Common/otbExtractROIBase.h index 1731ba0c4c..cb86a1d672 100755 --- a/Code/Common/otbExtractROIBase.h +++ b/Code/Common/otbExtractROIBase.h @@ -20,7 +20,12 @@ namespace otb { /** \class ExtractROIBase - * \brief Classe de base, permettant d'extraire une partie d'une image (mono-canal ou multi-canal). + * \brief Classe de base, permettant d'extraire une partie d'une image. + + * La région a extraire peut se définir via les méthodes SetStartX/Y (positionne le début) et SetSizeX/Y précisant + * la taille de la région. Si la position de la région n'est pas précisée, alors le premier en haut à gauche est + * sélectionné. Si la taille de la région n'est pas positionnée, alors la taille de la région s'étend jusqu'aux bords extrêmes de l'image. + * \note Si aucun paramètre n'est précisé, alors toute l'image est extraite. * */ template <class TInputImage, class TOutputImage> diff --git a/Code/Common/otbMultiChannelExtractROI.h b/Code/Common/otbMultiChannelExtractROI.h index cd0d430420..7c6f35912f 100755 --- a/Code/Common/otbMultiChannelExtractROI.h +++ b/Code/Common/otbMultiChannelExtractROI.h @@ -22,9 +22,14 @@ namespace otb { /** \class MultiChannelExtractROI - * \brief Extrait une partie d'une image. Il est possible d'extraire tous les canaux de l'image ou - * seulement ceux précisés par l'utilisateur. - * Cette classe s'appuie sur la classe "otb::ExtractROIBase" + * \brief Extrait une partie d'une image d'une image multi-canal. + * + * Il est possible d'extraire tous les canaux de l'image ou seulement ceux précisés par l'utilisateur. + * La méthode SetChannel permet de sélectionner un canal (une liste est incrémentée). + * Les méthodes SetFirstChannel/SetLastChannel permettent de définir une liste de canaux, définit par cet intervalle. + * \note Si aucun canal n'est spécifié par l'utilisateur, alors tous les canaux de l'image d'entrée sont traités + * \note Ces classe est paramétrée par le type de pixel des images d'entrée et de sortie. Les images manipulées dans cette classe + * sont de type "itk::VectorImage". * */ template <class TInputPixelType, class TOutputPixelType, unsigned int VImageDimension=2> diff --git a/Code/Common/otbVectorToRGBImageFilter.h b/Code/Common/otbVectorToRGBImageFilter.h deleted file mode 100755 index 74f1979b25..0000000000 --- a/Code/Common/otbVectorToRGBImageFilter.h +++ /dev/null @@ -1,83 +0,0 @@ - -#ifndef __otbVectorToRGBImageFilter_h -#define __otbVectorToRGBImageFilter_h - -#include "itkImageToImageFilter.h" -#include "itkImage.h" -#include "itkVectorImage.h" -#include "itkRGBPixel.h" - -namespace otb -{ - -/** \class VectorToRGBImageFilter - * - * \brief Creer une image RGB a partir d'une image multi-canal de type VectorImage - * Il est possible de sélectionner les trois canaux RGB de l'image source que l'on souhaite insérer dans l'image destination. - * - * \ingroup Multithreaded - */ - - -template <class TInputPixel, class TOutputPixel, unsigned int VImageDimension=2> -class ITK_EXPORT VectorToRGBImageFilter : - public itk::ImageToImageFilter< itk::VectorImage < TInputPixel, VImageDimension> , itk::Image<itk::RGBPixel<TOutputPixel> , VImageDimension> > -{ -public: - /** Standard class typedefs. */ - typedef VectorToRGBImageFilter Self; - typedef itk::ImageToImageFilter< itk::VectorImage < TInputPixel, VImageDimension> , itk::Image<itk::RGBPixel<TOutputPixel> , VImageDimension> > Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; - - /** Standard class macros */ - itkNewMacro(Self); - itkTypeMacro(VectorToRGBImageFilter, itk::ImageToImageFilter) ; - - typedef typename Superclass::OutputImageRegionType OutputImageRegionType ; - - typedef itk::VectorImage<TInputPixel,VImageDimension> InputImageType; - typedef itk::Image<itk::RGBPixel<TOutputPixel>,VImageDimension> OutputImageType; - - typedef typename OutputImageType::PixelType OutputImagePixelType ; - - /** Set/Get le numero de canal à traiter pour le canal rouge */ - itkSetMacro(RedChannel,unsigned int); - itkGetConstMacro(RedChannel,unsigned int); - /** Set/Get le numero de canal à traiter pour le canal vert */ - itkSetMacro(GreenChannel,unsigned int); - itkGetConstMacro(GreenChannel,unsigned int); - /** Set/Get le numero de canal à traiter pour le canal bleu */ - itkSetMacro(BlueChannel,unsigned int); - itkGetConstMacro(BlueChannel,unsigned int); - - -protected: - VectorToRGBImageFilter() ; - virtual ~VectorToRGBImageFilter() {} - - void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, - int threadId) ; - -private: - VectorToRGBImageFilter(const Self&); //purposely not implemented - void operator=(const Self&); //purposely not implemented - - - - /** Contient le numero de canal rouge a extraire */ - unsigned int m_RedChannel; - /** Contient le numero de canal vert a extraire */ - unsigned int m_GreenChannel; - /** Contient le numero de canal bleu a extraire */ - unsigned int m_BlueChannel; - -}; - -} // end namespace otb - -#ifndef OTB_MANUAL_INSTANTIATION -#include "otbVectorToRGBImageFilter.txx" -#endif - -#endif diff --git a/Code/Common/otbVectorToRGBImageFilter.txx b/Code/Common/otbVectorToRGBImageFilter.txx deleted file mode 100755 index 5d2e2b8d10..0000000000 --- a/Code/Common/otbVectorToRGBImageFilter.txx +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef _otbVectorToRGBImageFilter_txx -#define _otbVectorToRGBImageFilter_txx - -#include "otbVectorToRGBImageFilter.h" - -#include "itkImageRegionIterator.h" -#include "itkImageRegionConstIterator.h" -#include "itkProgressReporter.h" -#include "itkPixelTraits.h" - -namespace otb -{ - -/** - * Constructor - */ -template <class TInputPixel, class TOutputPixel, unsigned int VImageDimension> -VectorToRGBImageFilter< TInputPixel, TOutputPixel, VImageDimension > -::VectorToRGBImageFilter() : m_RedChannel(1), - m_GreenChannel(2), - m_BlueChannel(3) -{ -} - - -/** - * ThreadedGenerateData Performs the pixel-wise addition - */ -template <class TInputPixel, class TOutputPixel, unsigned int VImageDimension> -void -VectorToRGBImageFilter< TInputPixel, TOutputPixel, VImageDimension > -::ThreadedGenerateData( const OutputImageRegionType &outputRegionForThread, - int threadId) -{ - - typename OutputImageType::Pointer outputPtr = this->GetOutput(); - - typename InputImageType::Pointer inputPtr = (InputImageType*)(this->GetInput(0)); - - itk::ImageRegionIterator<OutputImageType> outputIt(outputPtr, outputRegionForThread); - - itk::ProgressReporter progress(this, - threadId, - outputRegionForThread.GetNumberOfPixels()); - outputIt.GoToBegin(); - typename OutputImageType::PixelType arrayPixel ; - - itk::ImageRegionConstIterator< InputImageType > inputIt(inputPtr, outputRegionForThread); - inputIt.GoToBegin(); - - while( !outputIt.IsAtEnd() ) - { - typename OutputImageType::PixelType pix; - - pix.SetRed(inputIt.Get().GetElement(m_RedChannel-1)); - pix.SetGreen(inputIt.Get().GetElement(m_GreenChannel-1)); - pix.SetBlue(inputIt.Get().GetElement(m_BlueChannel-1)); - outputIt.Set(pix); - ++inputIt; - ++outputIt; - progress.CompletedPixel(); - } -} - -} // end namespace otb - -#endif diff --git a/Code/Common/otbVectorToScalarImageFilter.h b/Code/Common/otbVectorToScalarImageFilter.h deleted file mode 100755 index b5f19f8bc8..0000000000 --- a/Code/Common/otbVectorToScalarImageFilter.h +++ /dev/null @@ -1,69 +0,0 @@ - -#ifndef __otbVectorToScalarImageFilter_h -#define __otbVectorToScalarImageFilter_h - -#include "itkImageToImageFilter.h" -#include "itkImage.h" -#include "itkVectorImage.h" - -namespace otb -{ - -/** \class VectorToScalarImageFilter - * - * \brief Creer une image mono-canal a partir d'une image multi-canal (type VectorImage) - * Il est possible de sélectionner le canal de l'image source que l'on souhaite extraire dans l'image destination. - * - * \ingroup Multithreaded - */ - - -template <class TInputPixel, class TOutputPixel, unsigned int VImageDimension=2> -class ITK_EXPORT VectorToScalarImageFilter : - public itk::ImageToImageFilter< itk::VectorImage < TInputPixel, VImageDimension> , itk::Image<TOutputPixel , VImageDimension> > -{ -public: - /** Standard class typedefs. */ - typedef VectorToScalarImageFilter Self; - typedef itk::ImageToImageFilter< itk::VectorImage < TInputPixel, VImageDimension> , itk::Image<TOutputPixel , VImageDimension> > Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; - - /** Standard class macros */ - itkNewMacro(Self); - itkTypeMacro(VectorToScalarImageFilter, itk::ImageToImageFilter) ; - - typedef typename Superclass::OutputImageRegionType OutputImageRegionType ; - - typedef itk::VectorImage<TInputPixel,VImageDimension> InputImageType; - typedef itk::Image<TOutputPixel,VImageDimension> OutputImageType; - - typedef typename OutputImageType::PixelType OutputImagePixelType ; - - /** Set/Get le numero de canal à traiter */ - itkSetMacro(Channel,unsigned int); - itkGetConstMacro(Channel,unsigned int); - -protected: - VectorToScalarImageFilter() ; - virtual ~VectorToScalarImageFilter() {} - - void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, - int threadId) ; - -private: - VectorToScalarImageFilter(const Self&); //purposely not implemented - void operator=(const Self&); //purposely not implemented - - /** Contient le numero de canal a extraire */ - unsigned int m_Channel; // [1...] - -}; - -} // end namespace otb - -#ifndef OTB_MANUAL_INSTANTIATION -#include "otbVectorToScalarImageFilter.txx" -#endif - -#endif diff --git a/Code/Common/otbVectorToScalarImageFilter.txx b/Code/Common/otbVectorToScalarImageFilter.txx deleted file mode 100755 index 78754b53f8..0000000000 --- a/Code/Common/otbVectorToScalarImageFilter.txx +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef _otbVectorToScalarImageFilter_txx -#define _otbVectorToScalarImageFilter_txx - -#include "otbVectorToScalarImageFilter.h" - -#include "itkImageRegionIterator.h" -#include "itkImageRegionConstIterator.h" -#include "itkProgressReporter.h" -#include "itkPixelTraits.h" - -namespace otb -{ - -/** - * Constructor - */ -template <class TInputPixel, class TOutputPixel, unsigned int VImageDimension> -VectorToScalarImageFilter< TInputPixel, TOutputPixel, VImageDimension > -::VectorToScalarImageFilter() : m_Channel(1) -{ -} - - -/** - * ThreadedGenerateData Performs the pixel-wise addition - */ -template <class TInputPixel, class TOutputPixel, unsigned int VImageDimension> -void -VectorToScalarImageFilter< TInputPixel, TOutputPixel, VImageDimension > -::ThreadedGenerateData( const OutputImageRegionType &outputRegionForThread, - int threadId) -{ - - typename OutputImageType::Pointer outputPtr = this->GetOutput(); - - typename InputImageType::Pointer inputPtr = (InputImageType*)(this->GetInput(0)); - - itk::ImageRegionIterator<OutputImageType> outputIt(outputPtr, outputRegionForThread); - - itk::ProgressReporter progress(this, - threadId, - outputRegionForThread.GetNumberOfPixels()); - outputIt.GoToBegin(); - typename OutputImageType::PixelType arrayPixel ; - - itk::ImageRegionConstIterator< InputImageType > inputIt(inputPtr, outputRegionForThread); - inputIt.GoToBegin(); - - while( !outputIt.IsAtEnd() ) - { -// typename OutputImageType::PixelType pix; - -// pix.Set(); - outputIt.Set(inputIt.Get().GetElement(m_Channel-1)); - ++inputIt; - ++outputIt; - progress.CompletedPixel(); - } -} - -} // end namespace otb - -#endif -- GitLab