ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
00001 /*========================================================================= 00002 * 00003 * Copyright Insight Software Consortium 00004 * 00005 * Licensed under the Apache License, Version 2.0 (the "License"); 00006 * you may not use this file except in compliance with the License. 00007 * You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0.txt 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 * 00017 *=========================================================================*/ 00018 #ifndef __itkPermuteAxesImageFilter_h 00019 #define __itkPermuteAxesImageFilter_h 00020 00021 #include "itkImageToImageFilter.h" 00022 #include "itkFixedArray.h" 00023 00024 namespace itk 00025 { 00050 template< class TImage > 00051 class ITK_EXPORT PermuteAxesImageFilter: 00052 public ImageToImageFilter< TImage, TImage > 00053 { 00054 public: 00056 typedef PermuteAxesImageFilter Self; 00057 typedef ImageToImageFilter< TImage, TImage > Superclass; 00058 typedef SmartPointer< Self > Pointer; 00059 typedef SmartPointer< const Self > ConstPointer; 00060 00062 itkNewMacro(Self); 00063 00065 itkTypeMacro(PermuteAxesImageFilter, ImageToImageFilter); 00066 00068 itkStaticConstMacro(ImageDimension, unsigned int, 00069 TImage::ImageDimension); 00070 00072 typedef typename Superclass::InputImagePointer InputImagePointer; 00073 typedef typename Superclass::OutputImagePointer OutputImagePointer; 00074 typedef typename Superclass::OutputImageRegionType OutputImageRegionType; 00075 00077 typedef FixedArray< unsigned int, itkGetStaticConstMacro(ImageDimension) > PermuteOrderArrayType; 00078 00081 void SetOrder(const PermuteOrderArrayType & order); 00082 00084 itkGetConstReferenceMacro(Order, PermuteOrderArrayType); 00085 00087 itkGetConstReferenceMacro(InverseOrder, PermuteOrderArrayType); 00088 00096 virtual void GenerateOutputInformation(); 00097 00103 virtual void GenerateInputRequestedRegion(); 00104 00105 protected: 00106 PermuteAxesImageFilter(); 00107 ~PermuteAxesImageFilter() {} 00108 void PrintSelf(std::ostream & os, Indent indent) const; 00109 00120 void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, 00121 ThreadIdType threadId); 00122 00123 private: 00124 PermuteAxesImageFilter(const Self &); //purposely not implemented 00125 void operator=(const Self &); //purposely not implemented 00126 00127 PermuteOrderArrayType m_Order; 00128 PermuteOrderArrayType m_InverseOrder; 00129 }; 00130 } // end namespace itk 00131 00132 #ifndef ITK_MANUAL_INSTANTIATION 00133 #include "itkPermuteAxesImageFilter.hxx" 00134 #endif 00135 00136 #endif 00137