26 for (
unsigned int i = 0; i < 8; i++)
32 picDesc->
dim = refImg->GetDimension();
33 memcpy(picDesc->
n, imDesc->GetDimensions(), picDesc->
dim *
sizeof(
unsigned int));
36 picDesc->
bpe = refImg->GetPixelType().GetBpe();
37 if (imageAccess !=
nullptr)
50 for (
unsigned int i = 0; i < 8; i++)
56 picDesc->
dim = refItem->GetDimension();
57 for (
unsigned int i = 0; i < picDesc->
dim; i++)
59 picDesc->
n[i] = refItem->GetDimension(i);
63 picDesc->
bpe = refItem->GetPixelType().GetBpe();
64 if (imageAccess !=
nullptr)
77 for (
unsigned int i = 0; i < 8; i++)
83 picDesc->
dim = refImg->GetDimension();
84 memcpy(picDesc->
n, imDesc->GetDimensions(), picDesc->
dim *
sizeof(
unsigned int));
87 picDesc->
bpe = refImg->GetPixelType().GetBpe();
98 for (
unsigned int i = 0; i < 8; i++)
104 picDesc->
dim = refItem->GetDimension();
105 for (
unsigned int i = 0; i < picDesc->
dim; i++)
107 picDesc->
n[i] = refItem->GetDimension(i);
111 picDesc->
bpe = refItem->GetPixelType().GetBpe();
112 picDesc->
data = refItem->GetData();
121 imDescriptor->Initialize(desc->
n, desc->
dim);
124 imDescriptor->AddNewChannel(ptype,
"imported by pic");
135 const bool isSignedIntegralType = (intype == itk::ImageIOBase::INT || intype == itk::ImageIOBase::SHORT ||
136 intype == itk::ImageIOBase::CHAR || intype == itk::ImageIOBase::LONG);
138 const bool isUnsignedIntegralType = (intype == itk::ImageIOBase::UINT || intype == itk::ImageIOBase::USHORT ||
139 intype == itk::ImageIOBase::UCHAR || intype == itk::ImageIOBase::ULONG);
141 const bool isFloatingPointType = (intype == itk::ImageIOBase::FLOAT || intype == itk::ImageIOBase::DOUBLE);
143 if (isSignedIntegralType)
145 if (isUnsignedIntegralType)
147 if (isFloatingPointType)
154 const bool isSignedIntegralType = (pictype ==
mitkIpPicInt);
155 const bool isUnsignedIntegralType = (pictype ==
mitkIpPicUInt);
157 if (isSignedIntegralType)
162 return MakeScalarPixelType<char>();
164 return MakeScalarPixelType<short>();
166 return MakeScalarPixelType<int>();
169 else if (isUnsignedIntegralType)
173 case sizeof(
unsigned char):
174 return MakeScalarPixelType<unsigned char>();
175 case sizeof(
unsigned short):
176 return MakeScalarPixelType<unsigned short>();
178 return MakeScalarPixelType<unsigned int>();
186 return MakeScalarPixelType<float>();
188 return MakeScalarPixelType<double>();
MITKLEGACYADAPTORS_EXPORT mitk::ImageDescriptor::Pointer CastToImageDescriptor(mitkIpPicDescriptor *desc)
Constructs an ImageDescriptor from legacy mitkIpPicDescriptor.
void * GetData()
Gives full data access.
MITKLEGACYADAPTORS_EXPORT PixelType CastToPixelType(mitkIpPicType_t pictype, vcl_size_t bpe)
Returns a mitk::PixelType object corresponding to given mitkIpPicType_t.
MITKLEGACYADAPTORS_EXPORT mitkIpPicType_t CastToIpPicType(int componentType)
Constructs a legacy type information from mitk::PixelType.
MITKLEGACYADAPTORS_EXPORT mitkIpPicDescriptor * CastToIpPicDescriptor(mitk::Image::Pointer, mitk::ImageWriteAccessor *, mitkIpPicDescriptor *picDesc)
Constructs a legacy mitkIpPicDescriptor from mitk::Image.
ImageWriteAccessor class to get locked write-access for a particular image part.
Class for defining the data type of pixels.