23 #include <vtkImageData.h> 26 #include <itkMutexLockHolder.h> 31 #define FILL_C_ARRAY(_arr, _size, _value) \ 32 for (unsigned int i = 0u; i < _size; i++) \ 40 m_Dimensions(nullptr),
41 m_ImageDescriptor(nullptr),
42 m_OffsetTable(nullptr),
43 m_CompleteData(nullptr),
44 m_ImageStatistics(nullptr)
75 for (
unsigned int i = 0u; i < time_steps; ++i)
146 value = (double)(((T *)data)[offset]);
150 const unsigned int rgboffset =
offset;
152 double returnvalue = (((T *)data)[rgboffset]);
153 returnvalue += (((T *)data)[rgboffset + 1]);
154 returnvalue += (((T *)data)[rgboffset + 2]);
175 if (position[0] < 0 || position[1] < 0 || position[2] < 0)
177 MITK_WARN <<
"Given position (" << position <<
") is out of image range, returning 0.";
181 else if ((
unsigned int)position[0] >= imageDims[0] || (
unsigned int)position[1] >= imageDims[1] ||
182 (imageDims[2] && (
unsigned int)position[2] >= imageDims[2]))
184 MITK_WARN <<
"Given position (" << position <<
") is out of image range, returning 0.";
188 const unsigned int offset = component +
190 position[2] * imageDims[0] * imageDims[1] +
191 timestep * imageDims[0] * imageDims[1] * imageDims[2]);
200 unsigned int timestep,
201 unsigned int component)
227 return volume.GetPointer() ==
nullptr ? nullptr : volume->GetVtkImageAccessor(
this)->GetVtkImageData();
240 return volume.GetPointer() ==
nullptr ? nullptr : volume->GetVtkImageAccessor(
this)->GetVtkImageData();
247 return GetSliceData_unlocked(s, t, n, data, importMemoryManagement);
256 const size_t ptypeSize = this->
m_ImageDescriptor->GetChannelTypeById(n).GetSize();
260 if (
m_Slices[pos].GetPointer() !=
nullptr)
268 if ((vol.GetPointer() !=
nullptr) && (vol->IsComplete()))
277 sl->SetComplete(
true);
283 if ((ch.GetPointer() !=
nullptr) && (ch->IsComplete()))
292 sl->SetComplete(
true);
312 if (IsSliceSet_unlocked(s, t, n))
314 return GetSliceData_unlocked(s, t, n, data, importMemoryManagement);
321 item->SetComplete(
true);
332 return GetVolumeData_unlocked(t, n, data, importMemoryManagement);
345 if ((vol.GetPointer() !=
nullptr) && (vol->IsComplete()))
348 const size_t ptypeSize = this->
m_ImageDescriptor->GetChannelTypeById(n).GetSize();
352 if ((ch.GetPointer() !=
nullptr) && (ch->IsComplete()))
361 vol->SetComplete(
true);
366 bool complete =
true;
379 if (m_Dimensions[2] <= 1)
382 sl = GetSliceData_unlocked(0, t, n, data, importMemoryManagement);
384 vol->SetComplete(
true);
392 if (vol.GetPointer() ==
nullptr)
394 vol =
new ImageDataItem(chPixelType, t, 3, m_Dimensions,
nullptr,
true);
396 vol->SetComplete(
true);
398 for (s = 0; s < m_Dimensions[2]; ++s)
405 if (sl->GetParent() != vol)
408 size_t offset = ((size_t)s) * size;
409 std::memcpy(static_cast<char *>(vol->GetData()) + offset, sl->GetData(), size);
416 sl->SetComplete(
true);
443 if (IsVolumeSet_unlocked(t, n))
445 return GetVolumeData_unlocked(t, n, data, importMemoryManagement);
452 item->SetComplete(
true);
462 return GetChannelData_unlocked(n, data, importMemoryManagement);
472 if ((ch.GetPointer() !=
nullptr) && (ch->IsComplete()))
476 if (IsChannelSet_unlocked(n))
481 vol = GetVolumeData_unlocked(0, n, data, importMemoryManagement);
488 ch->SetComplete(
true);
492 const size_t ptypeSize = this->
m_ImageDescriptor->GetChannelTypeById(n).GetSize();
496 if (ch.GetPointer() ==
nullptr)
498 ch->SetComplete(
true);
502 for (t = 0; t < m_Dimensions[3]; ++t)
508 vol = GetVolumeData_unlocked(t, n, data, importMemoryManagement);
510 if (vol->GetParent() != ch)
514 std::memcpy(static_cast<char *>(ch->GetData()) + offset, vol->GetData(), size);
520 vol->SetComplete(
true);
527 for (
unsigned int i = 0; i < m_Dimensions[2]; ++i, ++slicesIt)
558 if (IsChannelSet_unlocked(n))
560 return GetChannelData_unlocked(n, data, importMemoryManagement);
567 item->SetComplete(
true);
575 return IsSliceSet_unlocked(s, t, n);
578 bool mitk::Image::IsSliceSet_unlocked(
int s,
int t,
int n)
const 590 if ((vol.GetPointer() !=
nullptr) && (vol->IsComplete()))
595 if ((ch.GetPointer() !=
nullptr) && (ch->IsComplete()))
605 return IsVolumeSet_unlocked(t, n);
608 bool mitk::Image::IsVolumeSet_unlocked(
int t,
int n)
const 616 if ((vol.GetPointer() !=
nullptr) && (vol->IsComplete()))
621 if ((ch.GetPointer() !=
nullptr) && (ch->IsComplete()))
639 return IsChannelSet_unlocked(n);
642 bool mitk::Image::IsChannelSet_unlocked(
int n)
const 648 if ((ch.GetPointer() !=
nullptr) && (ch->IsComplete()))
655 if (IsVolumeSet_unlocked(t, n) ==
false)
686 const size_t ptypeSize = this->
m_ImageDescriptor->GetChannelTypeById(n).GetSize();
690 sl =
GetSliceData(s, t, n, data, importMemoryManagement);
691 if (sl->GetManageMemory() ==
false)
694 if (sl.GetPointer() ==
nullptr)
697 if (sl->GetData() != data)
698 std::memcpy(sl->GetData(), data,
m_OffsetTable[2] * (ptypeSize));
706 if (sl.GetPointer() ==
nullptr)
708 if (sl->GetData() != data)
709 std::memcpy(sl->GetData(), data,
m_OffsetTable[2] * (ptypeSize));
721 const size_t ptypeSize = this->
m_ImageDescriptor->GetChannelTypeById(n).GetSize();
726 if (vol->GetManageMemory() ==
false)
729 if (vol.GetPointer() ==
nullptr)
732 if (vol->GetData() != data)
733 std::memcpy(vol->GetData(), data,
m_OffsetTable[3] * (ptypeSize));
735 vol->SetComplete(
true);
742 if (vol.GetPointer() ==
nullptr)
744 if (vol->GetData() != data)
746 std::memcpy(vol->GetData(), data,
m_OffsetTable[3] * (ptypeSize));
748 vol->SetComplete(
true);
768 const size_t ptypeSize = this->
m_ImageDescriptor->GetChannelTypeById(n).GetSize();
774 if (ch->GetManageMemory() ==
false)
777 if (ch.GetPointer() ==
nullptr)
780 if (ch->GetData() != data)
781 std::memcpy(ch->GetData(), data,
m_OffsetTable[4] * (ptypeSize));
783 ch->SetComplete(
true);
790 if (ch.GetPointer() ==
nullptr)
792 if (ch->GetData() != data)
793 std::memcpy(ch->GetData(), data,
m_OffsetTable[4] * (ptypeSize));
794 ch->SetComplete(
true);
805 ImageDataItemPointerArray::iterator it, end;
835 inDesc->GetChannelDescriptor(0).GetPixelType(), inDesc->GetNumberOfDimensions(), inDesc->GetDimensions(), 1);
839 unsigned int dimension,
840 const unsigned int *dimensions,
841 unsigned int channels)
848 itkExceptionMacro(<<
"invalid zero dimension image");
851 for (i = 0; i < dimension; ++i)
853 if (dimensions[i] < 1)
854 itkExceptionMacro(<<
"invalid dimension[" << i <<
"]: " << dimensions[i]);
870 for (i = 0; i < 4; ++i)
885 for (
unsigned int i = 0u; i < channels; i++)
894 slicedGeometry->InitializeEvenlySpaced(planegeometry,
m_Dimensions[2]);
897 timeGeometry->Initialize(slicedGeometry,
m_Dimensions[3]);
898 for (
TimeStepType step = 0; step < timeGeometry->CountTimeSteps(); ++step)
900 timeGeometry->GetGeometryForTimeStep(step)->ImageGeometryOn();
921 unsigned int channels,
925 timeGeometry->Initialize(geometry.
Clone(), tDim);
926 this->
Initialize(type, *timeGeometry, channels, tDim);
931 unsigned int channels,
934 unsigned int dimensions[5];
941 unsigned int dimension = 2;
942 if (dimensions[2] > 1)
944 if (dimensions[3] > 1)
947 Initialize(type, dimension, dimensions, channels);
954 for (
TimeStepType step = 0; step < cloned->CountTimeSteps(); ++step)
956 if (!cloned->GetGeometryCloneForTimeStep(step)->GetImageGeometry())
958 MITK_WARN(
"Image.3DnT.Initialize") <<
" Attempt to initialize an image with a non-image geometry. " 959 "Re-interpretting the initialization geometry for timestep " 960 << step <<
" as image geometry, the original geometry remains unchanged.";
961 cloned->GetGeometryForTimeStep(step)->ImageGeometryOn();
969 if (!cloned->GetImageGeometry())
971 MITK_WARN(
"Image.Initialize") <<
" Attempt to initialize an image with a non-image geometry. Re-interpretting " 972 "the initialization geometry as image geometry, the original geometry remains " 974 cloned->ImageGeometryOn();
1007 mitkThrow() <<
"Use this method without the flipped parameter (direction is specified by the handedness of the PlaneGeometry instead).";
1013 unsigned int channels,
1017 slicedGeometry->InitializeEvenlySpaced(geometry2d.
Clone(), sDim);
1018 Initialize(type, *slicedGeometry, channels, tDim);
1028 if (vtkimagedata ==
nullptr)
1034 tmpDimensions[i] = vtkimagedata->GetDimensions()[i];
1035 if (m_Dimension < 4)
1038 for (i = 0, p = tmpDimensions + m_Dimension; i < 4 -
m_Dimension; ++i, ++p)
1044 tmpDimensions[1] = pDim;
1045 if (m_Dimension < 2)
1050 tmpDimensions[2] = sDim;
1051 if (m_Dimension < 3)
1056 tmpDimensions[3] = tDim;
1057 if (m_Dimension < 4)
1062 Initialize(pixelType, m_Dimension, tmpDimensions, channels);
1064 const double *spacinglist = vtkimagedata->GetSpacing();
1067 if (m_Dimension >= 2)
1068 spacing[1] = spacinglist[1];
1069 if (m_Dimension >= 3)
1070 spacing[2] = spacinglist[2];
1074 double vtkorigin[3];
1075 vtkimagedata->GetOrigin(vtkorigin);
1077 if (m_Dimension >= 2)
1078 origin[1] = vtkorigin[1];
1079 if (m_Dimension >= 3)
1080 origin[2] = vtkorigin[2];
1093 timeGeometry->Initialize(slicedGeometry,
m_Dimensions[3]);
1096 delete[] tmpDimensions;
1102 return ((s >= 0) && (s < (
int)
m_Dimensions[2]) && (t >= 0) && (t < (
int)m_Dimensions[3]) && (n >= 0) &&
1151 itkExceptionMacro(<<
"Invalid timestep in Image!");
1173 return AllocateSliceData_unlocked(s, t, n, data, importMemoryManagement);
1182 const size_t ptypeSize = this->
m_ImageDescriptor->GetChannelTypeById(n).GetSize();
1187 if (vol.GetPointer() !=
nullptr)
1196 sl->SetComplete(
true);
1202 if (ch.GetPointer() !=
nullptr)
1211 sl->SetComplete(
true);
1224 sl->SetComplete(
true);
1238 return AllocateVolumeData_unlocked(t, n, data, importMemoryManagement);
1247 const size_t ptypeSize = this->
m_ImageDescriptor->GetChannelTypeById(n).GetSize();
1252 if (ch.GetPointer() !=
nullptr)
1270 if (data !=
nullptr)
1271 std::memcpy(vol->GetData(), data,
m_OffsetTable[3] * (ptypeSize));
1285 return AllocateChannelData_unlocked(n, data, importMemoryManagement);
1295 const size_t ptypeSize = this->
m_ImageDescriptor->GetChannelTypeById(n).GetSize();
1298 if (data !=
nullptr)
1299 std::memcpy(ch->GetData(), data,
m_OffsetTable[4] * (ptypeSize));
1327 MITK_INFO <<
"WARNING: Applied a non-image geometry onto an image. Please be SURE that this geometry is " 1328 "pixel-center-based! If it is not, you need to call " 1329 "Geometry3D->ChangeImageGeometryConsideringOriginOffset(true) before calling image->setGeometry(..)\n";
1341 os << indent <<
" Dimension: " <<
m_Dimension << std::endl;
1342 os << indent <<
" Dimensions: ";
1347 for (
unsigned int ch = 0; ch < this->
m_ImageDescriptor->GetNumberOfChannels(); ch++)
1351 os << indent <<
" Channel: " << this->
m_ImageDescriptor->GetChannelName(ch) << std::endl;
1353 os << indent <<
" BytesPerElement: " << chPixelType.
GetSize() << std::endl;
1361 os << indent <<
" Image not initialized: m_Initialized: false" << std::endl;
1376 for (
short k = 0;
k < 3; ++
k)
1380 for (
short i = 0; i < 3; ++i)
1382 for (
short j = 0; j < 3; ++j)
1386 if (std::abs(mx[i][j]) > ref)
1459 if ((leftHandSide ==
nullptr) || (rightHandSide ==
nullptr))
1461 MITK_ERROR <<
"mitk::Equal(const mitk::Image* leftHandSide, const mitk::Image* rightHandSide, ScalarType eps, bool " 1462 "verbose) does not work with nullptr pointer input.";
1465 return mitk::Equal(*leftHandSide, *rightHandSide, eps, verbose);
1470 bool returnValue =
true;
1477 MITK_INFO <<
"[( Image )] Dimensionality differs.";
1481 returnValue =
false;
1486 for (
unsigned int i = 0; i < minDimensionality; ++i)
1490 returnValue =
false;
1493 MITK_INFO <<
"[( Image )] dimension differs.";
1495 <<
"rightHandSide->GetDimension(" << i <<
") is " << rightHandSide.
GetDimension(i);
1503 if (!(pixelTypeRightHandSide == pixelTypeLeftHandSide))
1507 MITK_INFO <<
"[( Image )] PixelType differs.";
1511 returnValue =
false;
1519 MITK_INFO <<
"[( Image )] Geometries differ.";
1521 returnValue =
false;
1530 compareFilter->SetInput(0, &rightHandSide);
1531 compareFilter->SetInput(1, &leftHandSide);
1532 compareFilter->SetTolerance(eps);
1533 compareFilter->Update();
1535 if ((!compareFilter->GetResult()))
1537 returnValue =
false;
1540 MITK_INFO <<
"[(Image)] Pixel values differ: ";
1541 compareFilter->GetCompareResults().PrintSelf();
bool IsChannelSet(int n=0) const override
Check whether the channel n is set.
void SetRequestedRegionToLargestPossibleRegion() override
vcl_size_t GetBitsPerComponent() const
Get the number of bits per components.
void SetGeometry(BaseGeometry *aGeometry3D) override
Set the BaseGeometry of the data, which will be referenced (not copied!). It has to be a sub-class of...
itk::SmartPointer< mitk::BaseDataSource > GetSource() const
Get the process object that generated this data object.
unsigned int * m_Dimensions
ScalarType GetScalarValueMinNoRecompute(unsigned int t=0) const
(DEPRECATED) Get the smallest value for scalar images, but do not recompute it first ...
void PrintSelf(std::ostream &os, itk::Indent indent) const override
virtual bool GetImageGeometry() const
Is this an ImageGeometry?
virtual TimeStepType CountTimeSteps() const =0
Returns the number of time steps.
std::string GetTypeAsString() const
Returns a string representing the pixel type and pixel components.
virtual BaseGeometry::Pointer GetGeometryCloneForTimeStep(TimeStepType timeStep) const =0
Returns a clone of the geometry of a specific time point.
ScalarType GetScalarValue2ndMin(int t=0) const
(DEPRECATED) Get the second smallest value for scalar images
void SetSpacing(const mitk::Vector3D &aSpacing, bool enforceSetSpacing=false)
Set the spacing (m_Spacing).
unsigned int GetCountOfMinValuedVoxelsNoRecompute(unsigned int t=0) const
(DEPRECATED) Get the count of voxels with the smallest scalar value in the dataset ...
virtual ScalarType GetScalarValue2ndMin(int t=0, unsigned int component=0)
Get the second smallest value for scalar images. Recomputation performed only when necessary...
virtual ImageDataItemPointer GetSliceData(int s=0, int t=0, int n=0, void *data=nullptr, ImportMemoryManagementType importMemoryManagement=CopyMemory) const
virtual bool IsValidChannel(int n=0) const
Check whether the channel n is valid, i.e., is (or can be) inside of the image.
const mitk::PixelType GetPixelType(int n=0) const
Returns the PixelType of channel n.
void Initialize() override
vcl_size_t GetNumberOfComponents() const
Get the number of components of which each element consists.
ImageDataItemPointerArray m_Slices
virtual ScalarType GetScalarValue2ndMax(int t=0, unsigned int component=0)
Get the second largest value for scalar images.
unsigned int * GetDimensions() const
Get the sizes of all dimensions as an integer-array.
virtual bool SetImportChannel(void *data, int n=0, ImportMemoryManagementType importMemoryManagement=CopyMemory)
Set data in channel n. It is in the responsibility of the caller to ensure that the data vector data ...
bool IsVolumeSet(int t=0, int n=0) const override
Check whether volume at time t in channel n is set.
bool IsSliceSet(int s=0, int t=0, int n=0) const override
Get the complete image, i.e., all channels linked together, as a mitkIpPicDescriptor.
vcl_size_t * m_OffsetTable
ScalarType GetScalarValueMax(int t=0) const
(DEPRECATED) Get the maximum for scalar images
virtual mitk::ScalarType GetScalarValue2ndMaxNoRecompute(unsigned int t=0)
Get the second largest value for scalar images, but do not recompute it first.
virtual void SetTimeGeometry(TimeGeometry *geometry)
Set the TimeGeometry of the data, which will be referenced (not copied!).
virtual bool SetImportSlice(void *data, int s=0, int t=0, int n=0, ImportMemoryManagementType importMemoryManagement=CopyMemory)
Set data as slice s at time t in channel n. It is in the responsibility of the caller to ensure that ...
ImageDataItemPointerArray m_Channels
virtual vtkImageData * GetVtkImageData(int t=0, int n=0)
Get a volume at a specific time t of channel n as a vtkImageData.
ScalarType GetScalarValue2ndMinNoRecompute(unsigned int t=0) const
(DEPRECATED) Get the second smallest value for scalar images, but do not recompute it first ...
RegionType m_RequestedRegion
virtual mitk::ScalarType GetScalarValueMaxNoRecompute(unsigned int t=0)
Get the largest value for scalar images, but do not recompute it first.
void SetGeometry(BaseGeometry *aGeometry3D) override
Sets a geometry to an image.
ScalarType GetCountOfMaxValuedVoxels(int t=0) const
(DEPRECATED) Get the count of voxels with the largest scalar value in the dataset ...
bool IsRotated() const
Returns true if an image is rotated, i.e. its geometry's transformation matrix has nonzero elements b...
ScalarType GetScalarValueMin(int t=0) const
(DEPRECATED) Get the minimum for scalar images
void AccessPixel(const mitk::PixelType ptype, void *data, const unsigned int offset, double &value)
virtual ImageDataItemPointer GetChannelData(int n=0, void *data=nullptr, ImportMemoryManagementType importMemoryManagement=CopyMemory) const
void FillVector3D(Tout &out, mitk::ScalarType x, mitk::ScalarType y, mitk::ScalarType z)
ImageDataItemPointerArray m_Volumes
void PrintSelf(std::ostream &os, itk::Indent indent) const override
virtual unsigned int GetCountOfMaxValuedVoxelsNoRecompute(unsigned int t=0)
Get the count of voxels with the largest scalar value in the dataset.
virtual mitk::PlaneGeometry * GetPlaneGeometry(int s) const
Returns the PlaneGeometry of the slice (s).
vcl_size_t GetBpe() const
Get the number of bits per element (of an element)
virtual bool SetVolume(const void *data, int t=0, int n=0)
Set data as volume at time t in channel n. It is in the responsibility of the caller to ensure that t...
itk::SimpleFastMutexLock m_ImageDataArraysLock
virtual ScalarType GetScalarValueMin(int t=0, unsigned int component=0)
Get the minimum for scalar images. Recomputation performed only when necessary.
virtual ImageDataItemPointer AllocateVolumeData(int t=0, int n=0, void *data=nullptr, ImportMemoryManagementType importMemoryManagement=CopyMemory) const
virtual bool SetSlice(const void *data, int s=0, int t=0, int n=0)
Set data as slice s at time t in channel n. It is in the responsibility of the caller to ensure that ...
const mitk::TimeGeometry * GetTimeGeometry() const
Return the TimeGeometry of the data as const pointer.
ScalarType GetCountOfMinValuedVoxels(int t=0) const
(DEPRECATED) Get the count of voxels with the smallest scalar value in the dataset ...
StatisticsHolderPointer m_ImageStatistics
double GetPixelValueByWorldCoordinate(const mitk::Point3D &position, unsigned int timestep=0, unsigned int component=0)
Get the pixel value at one specific world position.
MITKCORE_EXPORT mitk::PixelType MakePixelType(vtkImageData *vtkimagedata)
deduct the PixelType for a given vtk image
ScalarType GetScalarValue2ndMax(int t=0) const
(DEPRECATED) Get the second largest value for scalar images
unsigned int GetNumberOfChannels() const
Get the number of channels.
void Clear() override
Calls ClearData() and InitializeEmpty();.
unsigned int GetDimension() const
Get dimension of the image.
virtual bool IsValidVolume(int t=0, int n=0) const
Check whether volume at time t in channel n is valid, i.e., is (or can be) inside of the image...
#define mitkPixelTypeMultiplex3(function, ptype, param1, param2, param3)
Super class of data objects consisting of slices.
#define MAX_IMAGE_DIMENSIONS
Defines the maximum of 8 dimensions per image channel taken from ipPicDescriptor. ...
ScalarType GetScalarValue2ndMaxNoRecompute(unsigned int t=0) const
(DEPRECATED) Get the second largest value for scalar images, but do not recompute it first ...
virtual ScalarType GetScalarValueMax(int t=0, unsigned int component=0)
Get the maximum for scalar images. Recomputation performed only when necessary.
void SetOrigin(const Point3D &origin)
Set the origin, i.e. the upper-left corner of the plane.
virtual ImageDataItemPointer GetVolumeData(int t=0, int n=0, void *data=nullptr, ImportMemoryManagementType importMemoryManagement=CopyMemory) const
Image class for storing images.
virtual ImageDataItemPointer AllocateChannelData(int n=0, void *data=nullptr, ImportMemoryManagementType importMemoryManagement=CopyMemory) const
#define FILL_C_ARRAY(_arr, _size, _value)
virtual bool SetImportVolume(void *data, int t=0, int n=0, ImportMemoryManagementType importMemoryManagement=CopyMemory)
Set data as volume at time t in channel n. It is in the responsibility of the caller to ensure that t...
SlicedGeometry3D * GetSlicedGeometry(unsigned int t=0) const
Convenience access method for the geometry, which is of type SlicedGeometry3D (or a sub-class of it)...
RegionType m_LargestPossibleRegion
virtual bool IsValidSlice(int s=0, int t=0, int n=0) const
Check whether slice s at time t in channel n is valid, i.e., is (or can be) inside of the image...
double GetPixelValueByIndex(const itk::Index< 3 > &position, unsigned int timestep=0, unsigned int component=0)
Get the pixel value at one specific index position.
std::vcl_size_t TimeStepType
mitk::Image::Pointer image
virtual mitk::ScalarType GetScalarValueMinNoRecompute(unsigned int t=0) const
Get the smallest value for scalar images, but do not recompute it first.
void WorldToIndex(const mitk::Point3D &pt_mm, mitk::Point3D &pt_units) const
Convert world coordinates (in mm) of a point to (continuous!) index coordinates.
Describes the geometry of a data object consisting of slices.
vcl_size_t GetSize() const
Get size of the PixelType in bytes.
virtual bool SetChannel(const void *data, int n=0)
Set data in channel n. It is in the responsibility of the caller to ensure that the data vector data ...
Class holding the statistics informations about a single mitk::Image.
virtual void Clear()
Calls ClearData() and InitializeEmpty();.
virtual void * GetData()
Get the data vector of the complete image, i.e., of all channels linked together. ...
virtual bool IsValidTimeStep(int t) const
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.
virtual unsigned int GetCountOfMinValuedVoxelsNoRecompute(unsigned int t=0) const
Get the count of voxels with the smallest scalar value in the dataset.
unsigned int GetCountOfMaxValuedVoxelsNoRecompute(unsigned int t=0) const
(DEPRECATED) Get the count of voxels with the largest scalar value in the dataset ...
virtual BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const =0
Returns the geometry which corresponds to the given time step.
void Expand(unsigned int timeSteps) override
Expands the TimeGeometry to a number of TimeSteps.
bool m_RequestedRegionInitialized
int GetSliceIndex(int s=0, int t=0, int n=0) const
virtual ImageDataItemPointer AllocateSliceData(int s=0, int t=0, int n=0, void *data=nullptr, ImportMemoryManagementType importMemoryManagement=CopyMemory) const
MITKCORE_EXPORT const ScalarType eps
unsigned int GetTimeSteps() const
Get the number of time steps from the TimeGeometry As the base data has not a data vector given by it...
void ComputeOffsetTable()
Describes a two-dimensional, rectangular plane.
Internal class for managing references on sub-images.
ScalarType GetScalarValueMaxNoRecompute(unsigned int t=0) const
(DEPRECATED) Get the largest value for scalar images, but do not recompute it first ...
mitk::BaseGeometry * GetGeometry(int t=0) const
Return the geometry, which is a TimeGeometry, of the data as non-const pointer.
virtual void Expand(unsigned int timeSteps)
Expands the TimeGeometry to a number of TimeSteps.
ImageDataItemPointer m_CompleteData
mitk::ScalarType GetCountOfMinValuedVoxels(int t=0, unsigned int component=0)
Get the count of voxels with the smallest scalar value in the dataset.
std::string GetComponentTypeAsString() const
Returns a string containing the name of the component.
int GetVolumeIndex(int t=0, int n=0) const
std::string GetPixelTypeAsString() const
Returns a string containing the ITK pixel type name.
ImportMemoryManagementType
mitk::ScalarType GetCountOfMaxValuedVoxels(int t=0, unsigned int component=0)
Get the count of voxels with the largest scalar value in the dataset.
BaseGeometry Describes the geometry of a data object.
Class for defining the data type of pixels.
virtual mitk::ScalarType GetScalarValue2ndMinNoRecompute(unsigned int t=0) const
Get the second smallest value for scalar images, but do not recompute it first.
mitk::AffineTransform3D * GetIndexToWorldTransform()
Get the transformation used to convert from index to world coordinates.
ImageDescriptor::Pointer m_ImageDescriptor