SimpleITK  
sitkImageConvert.h
Go to the documentation of this file.
1 /*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18 #ifndef sitkImageConvert_h
19 #define sitkImageConvert_h
20 
21 #include "sitkImage.h"
22 
23 namespace itk
24 {
25 
26 template< typename T, unsigned int NVectorDimension > class Vector;
27 template< typename T, unsigned int NVectorDimension > class CovariantVector;
28 template< unsigned int VDimension> struct Offset;
29 
30 namespace simple
31 {
32 
33 
39 template< typename TPixelType, unsigned int ImageDimension >
42 GetImageFromVectorImage( itk::VectorImage< TPixelType, ImageDimension > *img, bool transferOwnership = false );
43 
44 
45 template< typename TPixelType, unsigned int ImageDimension >
49 
50 // method to convert a scalar image to a VectorImage changing the first dimension to the vector components
51 template< typename TPixelType, unsigned int ImageDimension >
53 typename itk::VectorImage< TPixelType, ImageDimension-1>::Pointer
55 
56 template< class TPixelType, unsigned int NImageDimension, unsigned int NLength >
59 GetVectorImageFromImage( itk::Image< itk::Vector< TPixelType, NLength >, NImageDimension> *img, bool transferOwnership = false );
60 
61 template< class TPixelType, unsigned int NImageDimension, unsigned int NLength >
64 GetVectorImageFromImage( itk::Image< itk::CovariantVector< TPixelType, NLength >, NImageDimension> *img, bool transferOwnership = false );
65 
66 
67 template< unsigned int NImageDimension, unsigned int NLength >
69 typename itk::VectorImage<
70  typename std::conditional<sizeof(typename itk::Offset< NLength >::OffsetValueType) == sizeof(int64_t),
71  int64_t,
72  int32_t>::type, NImageDimension >::Pointer
73 GetVectorImageFromImage( itk::Image< itk::Offset< NLength >, NImageDimension> *img, bool transferOwnership = false );
76 }
77 }
78 
79 #endif // sitkImageConvert_h
itk::VectorImage
itk::VectorImage
Definition: sitkPixelIDTypes.h:27
sitkImage.h
itk::Vector
Definition: sitkImageConvert.h:26
SmartPointer< Self >
SITKCommon_HIDDEN
#define SITKCommon_HIDDEN
Definition: sitkCommon.h:44
itk::simple::GetScalarImageFromVectorImage
SITKCommon_HIDDEN itk::Image< TPixelType, ImageDimension+1 >::Pointer GetScalarImageFromVectorImage(itk::VectorImage< TPixelType, ImageDimension > *img)
Utility methods to convert between itk image types efficiently by sharing the buffer between the inpu...
itk::CovariantVector
Definition: sitkImageConvert.h:27
itk::Offset
Definition: sitkImageConvert.h:28
itk::Offset::OffsetValueType
itk::OffsetValueType OffsetValueType
itk::simple::GetVectorImageFromScalarImage
SITKCommon_HIDDEN itk::VectorImage< TPixelType, ImageDimension-1 >::Pointer GetVectorImageFromScalarImage(itk::Image< TPixelType, ImageDimension > *img)
Utility methods to convert between itk image types efficiently by sharing the buffer between the inpu...
itk
itk::simple::GetVectorImageFromImage
SITKCommon_HIDDEN itk::VectorImage< TPixelType, NImageDimension >::Pointer GetVectorImageFromImage(itk::Image< itk::Vector< TPixelType, NLength >, NImageDimension > *img, bool transferOwnership=false)
Utility methods to convert between itk image types efficiently by sharing the buffer between the inpu...
itk::Image
Definition: sitkPixelIDTypes.h:26
itk::simple::GetImageFromVectorImage
SITKCommon_HIDDEN itk::Image< itk::Vector< TPixelType, ImageDimension >, ImageDimension >::Pointer GetImageFromVectorImage(itk::VectorImage< TPixelType, ImageDimension > *img, bool transferOwnership=false)
Utility methods to convert between itk image types efficiently by sharing the buffer between the inpu...