Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
LabelSetImage class for handling labels and layers in a segmentation session. More...
#include <mitkLabelSetImage.h>
Public Types | |
typedef mitk::Label::PixelType | PixelType |
![]() | |
enum | ImportMemoryManagementType { CopyMemory, ManageMemory, ReferenceMemory, DontManageMemory } |
typedef Image | Self |
typedef SlicedData | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
typedef itk::SmartPointer< ImageDataItem > | ImageDataItemPointer |
typedef itk::Statistics::Histogram< double > | HistogramType |
typedef mitk::ImageStatisticsHolder * | StatisticsHolderPointer |
typedef std::vector< ImageDataItemPointer > | ImageDataItemPointerArray |
Vector container of SmartPointers to ImageDataItems; Class is only for internal usage to allow convenient access to all slices over iterators; See documentation of ImageDataItem for details. More... | |
![]() | |
typedef SlicedData | Self |
typedef BaseData | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
typedef itk::ImageRegion< RegionDimension > | RegionType |
typedef itk::Index< RegionDimension > | IndexType |
typedef IndexType::IndexValueType | IndexValueType |
typedef itk::Offset< RegionDimension > | OffsetType |
typedef OffsetType::OffsetValueType | OffsetValueType |
typedef itk::Size< RegionDimension > | SizeType |
typedef SizeType::SizeValueType | SizeValueType |
![]() | |
typedef BaseData | Self |
typedef itk::DataObject | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
![]() | |
using | UIDType = std::string |
Public Member Functions | |
mitkClassMacro (LabelSetImage, Image) | |
void | Initialize (const mitk::Image *image) override |
void | Concatenate (mitk::LabelSetImage *image) |
void | ClearBuffer () |
void | MergeLabel (PixelType pixelValue, PixelType sourcePixelValue, unsigned int layer=0) |
Merges the mitk::Label with a given target value with the active label. More... | |
void | MergeLabels (PixelType pixelValue, std::vector< PixelType > &vectorOfSourcePixelValues, unsigned int layer=0) |
Merges a list of mitk::Labels with the mitk::Label that has a specific value. More... | |
void | UpdateCenterOfMass (PixelType pixelValue, unsigned int layer=0) |
void | RemoveLabels (std::vector< PixelType > &VectorOfLabelPixelValues, unsigned int layer=0) |
Removes labels from the mitk::LabelSet of given layer. Calls mitk::LabelSetImage::EraseLabels() which also removes the labels from within the image. More... | |
void | EraseLabel (PixelType pixelValue, unsigned int layer=0) |
Erases the label with the given value in the given layer from the underlying image. The label itself will not be erased from the respective mitk::LabelSet. In order to remove the label itself use mitk::LabelSetImage::RemoveLabels() More... | |
void | EraseLabels (std::vector< PixelType > &VectorOfLabelPixelValues, unsigned int layer=0) |
Similar to mitk::LabelSetImage::EraseLabel() this funtion erase a list of labels from the image. More... | |
bool | ExistLabel (PixelType pixelValue) const |
Returns true if the value exists in one of the labelsets. More... | |
bool | ExistLabel (PixelType pixelValue, unsigned int layer) const |
Checks if a label exists in a certain layer. More... | |
bool | ExistLabelSet (unsigned int layer) const |
Returns true if the labelset exists. More... | |
mitk::Label * | GetActiveLabel (unsigned int layer=0) |
Returns the active label of a specific layer. More... | |
mitk::Label * | GetLabel (PixelType pixelValue, unsigned int layer=0) const |
Returns the mitk::Label with the given pixelValue and for the given layer. More... | |
mitk::LabelSet * | GetActiveLabelSet () |
Returns the currently active mitk::LabelSet. More... | |
mitk::LabelSet * | GetLabelSet (unsigned int layer=0) |
Gets the mitk::LabelSet for the given layer. More... | |
const mitk::LabelSet * | GetLabelSet (unsigned int layer=0) const |
unsigned int | GetActiveLayer () const |
Gets the ID of the currently active layer. More... | |
unsigned int | GetNumberOfLabels (unsigned int layer=0) const |
Get the number of all existing mitk::Labels for a given layer. More... | |
unsigned int | GetTotalNumberOfLabels () const |
Returns the number of all labels summed up across all layers. More... | |
mitk::Image::Pointer | CreateLabelMask (PixelType index, bool useActiveLayer=true, unsigned int layer=0) |
void | InitializeByLabeledImage (mitk::Image::Pointer image) |
Initialize a new mitk::LabelSetImage by an given image. For all distinct pixel values of the parameter image new labels will be created. If the number of distinct pixel values exceeds mitk::Label::MAX_LABEL_VALUE a new layer will be created. More... | |
void | MaskStamp (mitk::Image *mask, bool forceOverwrite) |
void | SetActiveLayer (unsigned int layer) |
unsigned int | GetNumberOfLayers () const |
unsigned int | AddLayer (mitk::LabelSet::Pointer layer=nullptr) |
Adds a new layer to the LabelSetImage. The new layer will be set as the active one. More... | |
unsigned int | AddLayer (mitk::Image::Pointer layerImage, mitk::LabelSet::Pointer lset=nullptr) |
Add a layer based on a provided mitk::Image. More... | |
void | AddLabelSetToLayer (const unsigned int layerIdx, const mitk::LabelSet::Pointer labelSet) |
Add a LabelSet to an existing layer. More... | |
void | RemoveLayer () |
Removes the active layer and the respective mitk::LabelSet and image information. The new active layer is the one below, if exists. More... | |
mitk::Image * | GetLayerImage (unsigned int layer) |
const mitk::Image * | GetLayerImage (unsigned int layer) const |
void | OnLabelSetModified () |
void | SetExteriorLabel (mitk::Label *label) |
Sets the label which is used as default exterior label when creating a new layer. More... | |
mitk::Label * | GetExteriorLabel () |
Gets the mitk::Label which is used as default exterior label. More... | |
const mitk::Label * | GetExteriorLabel () const |
![]() | |
virtual std::vector< std::string > | GetClassHierarchy () const override |
virtual const char * | GetClassName () const |
Pointer | Clone () const |
const mitk::PixelType | GetPixelType (int n=0) const |
Returns the PixelType of channel n. More... | |
unsigned int | GetDimension () const |
Get dimension of the image. More... | |
unsigned int | GetDimension (int i) const |
Get the size of dimension i (e.g., i=0 results in the number of pixels in x-direction). More... | |
virtual void * | GetData () |
Get the data vector of the complete image, i.e., of all channels linked together. More... | |
double | GetPixelValueByIndex (const itk::Index< 3 > &position, unsigned int timestep=0, unsigned int component=0) |
Get the pixel value at one specific index position. More... | |
double | GetPixelValueByWorldCoordinate (const mitk::Point3D &position, unsigned int timestep=0, unsigned int component=0) |
Get the pixel value at one specific world position. More... | |
virtual vtkImageData * | GetVtkImageData (int t=0, int n=0) |
Get a volume at a specific time t of channel n as a vtkImageData. More... | |
virtual const vtkImageData * | GetVtkImageData (int t=0, int n=0) const |
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. More... | |
bool | IsVolumeSet (int t=0, int n=0) const override |
Check whether volume at time t in channel n is set. More... | |
bool | IsChannelSet (int n=0) const override |
Check whether the channel n is set. More... | |
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 the data vector data is really a slice (at least is not smaller than a slice), since there is no chance to check this. More... | |
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 the data vector data is really a volume (at least is not smaller than a volume), since there is no chance to check this. More... | |
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 is really a channel (at least is not smaller than a channel), since there is no chance to check this. More... | |
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 the data vector data is really a slice (at least is not smaller than a slice), since there is no chance to check this. More... | |
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 the data vector data is really a volume (at least is not smaller than a volume), since there is no chance to check this. More... | |
virtual bool | SetImportVolume (const void *const_data, int t=0, int n=0) |
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 is really a channel (at least is not smaller than a channel), since there is no chance to check this. More... | |
virtual void | Initialize (const mitk::PixelType &type, unsigned int dimension, const unsigned int *dimensions, unsigned int channels=1) |
virtual void | Initialize (const mitk::PixelType &type, const mitk::BaseGeometry &geometry, unsigned int channels=1, int tDim=1) |
virtual void | Initialize (const mitk::PixelType &, const mitk::TimeSlicedGeometry *, unsigned int, int) |
virtual void | Initialize (const mitk::PixelType &type, const mitk::TimeGeometry &geometry, unsigned int channels=1, int tDim=-1) |
Initialize new (or re-initialize) image information by a TimeGeometry. More... | |
virtual void | Initialize (const mitk::PixelType &type, int sDim, const mitk::PlaneGeometry &geometry2d, bool flipped, unsigned int channels=1, int tDim=1) |
virtual void | Initialize (const mitk::PixelType &type, int sDim, const mitk::PlaneGeometry &geometry2d, unsigned int channels=1, int tDim=1) |
virtual void | Initialize (const mitk::ImageDescriptor::Pointer inDesc) |
virtual void | Initialize (vtkImageData *vtkimagedata, int channels=1, int tDim=-1, int sDim=-1, int pDim=-1) |
template<typename itkImageType > | |
void | InitializeByItk (const itkImageType *itkimage, int channels=1, int tDim=-1, int sDim=-1) |
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. More... | |
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. More... | |
virtual bool | IsValidChannel (int n=0) const |
Check whether the channel n is valid, i.e., is (or can be) inside of the image. More... | |
bool | IsRotated () const |
Returns true if an image is rotated, i.e. its geometry's transformation matrix has nonzero elements besides the diagonal. Non-diagonal elements are checked if larger then 1/1000 of the matrix' trace. More... | |
unsigned int * | GetDimensions () const |
Get the sizes of all dimensions as an integer-array. More... | |
ImageDescriptor::Pointer | GetImageDescriptor () const |
ChannelDescriptor | GetChannelDescriptor (int id=0) const |
void | SetGeometry (BaseGeometry *aGeometry3D) override |
Sets a geometry to an image. More... | |
virtual ImageDataItemPointer | GetSliceData (int s=0, int t=0, int n=0, void *data=nullptr, ImportMemoryManagementType importMemoryManagement=CopyMemory) const |
virtual ImageDataItemPointer | GetVolumeData (int t=0, int n=0, void *data=nullptr, ImportMemoryManagementType importMemoryManagement=CopyMemory) const |
virtual ImageDataItemPointer | GetChannelData (int n=0, void *data=nullptr, ImportMemoryManagementType importMemoryManagement=CopyMemory) const |
ScalarType | GetScalarValueMin (int t=0) const |
(DEPRECATED) Get the minimum for scalar images More... | |
ScalarType | GetScalarValueMax (int t=0) const |
(DEPRECATED) Get the maximum for scalar images More... | |
ScalarType | GetScalarValue2ndMin (int t=0) const |
(DEPRECATED) Get the second smallest value for scalar images More... | |
ScalarType | GetScalarValueMinNoRecompute (unsigned int t=0) const |
(DEPRECATED) Get the smallest value for scalar images, but do not recompute it first More... | |
ScalarType | GetScalarValue2ndMinNoRecompute (unsigned int t=0) const |
(DEPRECATED) Get the second smallest value for scalar images, but do not recompute it first More... | |
ScalarType | GetScalarValue2ndMax (int t=0) const |
(DEPRECATED) Get the second largest value for scalar images More... | |
ScalarType | GetScalarValueMaxNoRecompute (unsigned int t=0) const |
(DEPRECATED) Get the largest value for scalar images, but do not recompute it first More... | |
ScalarType | GetScalarValue2ndMaxNoRecompute (unsigned int t=0) const |
(DEPRECATED) Get the second largest value for scalar images, but do not recompute it first More... | |
ScalarType | GetCountOfMinValuedVoxels (int t=0) const |
(DEPRECATED) Get the count of voxels with the smallest scalar value in the dataset More... | |
ScalarType | GetCountOfMaxValuedVoxels (int t=0) const |
(DEPRECATED) Get the count of voxels with the largest scalar value in the dataset More... | |
unsigned int | GetCountOfMaxValuedVoxelsNoRecompute (unsigned int t=0) const |
(DEPRECATED) Get the count of voxels with the largest scalar value in the dataset More... | |
unsigned int | GetCountOfMinValuedVoxelsNoRecompute (unsigned int t=0) const |
(DEPRECATED) Get the count of voxels with the smallest scalar value in the dataset More... | |
StatisticsHolderPointer | GetStatistics () const |
Returns a pointer to the ImageStatisticsHolder object that holds all statistics information for the image. More... | |
![]() | |
itkStaticConstMacro (RegionDimension, unsigned int, 5) | |
void | UpdateOutputInformation () override |
void | PrepareForNewData () override |
void | SetRequestedRegionToLargestPossibleRegion () override |
bool | RequestedRegionIsOutsideOfTheBufferedRegion () override |
bool | VerifyRequestedRegion () override |
Verify that the RequestedRegion is within the LargestPossibleRegion. More... | |
void | SetRequestedRegion (const itk::DataObject *data) override |
virtual void | SetRequestedRegion (SlicedData::RegionType *region) |
void | SetLargestPossibleRegion (SlicedData::RegionType *region) |
Sets the largest possible region. The largest possible region is the entire region occupied by the data object. Note that the largest possible region should always be bigger then the requested region of a certain operation. More... | |
const RegionType & | GetLargestPossibleRegion () const |
virtual const RegionType & | GetRequestedRegion () const |
void | CopyInformation (const itk::DataObject *data) override |
unsigned int | GetNumberOfChannels () const |
Get the number of channels. More... | |
SlicedGeometry3D * | GetSlicedGeometry (unsigned int t=0) const |
Convenience access method for the geometry, which is of type SlicedGeometry3D (or a sub-class of it). More... | |
const SlicedGeometry3D * | GetUpdatedSlicedGeometry (unsigned int t=0) |
Convenience access method for the geometry, which is of type SlicedGeometry3D (or a sub-class of it). More... | |
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 SlicedGeometry3D. More... | |
void | SetOrigin (const Point3D &origin) override |
Convenience method for setting the origin of the SlicedGeometry3D instances of all time steps. More... | |
virtual void | SetSpacing (const ScalarType aSpacing[]) |
Convenience method for setting the spacing of the SlicedGeometry3D instances of all time steps. More... | |
virtual void | SetSpacing (mitk::Vector3D aSpacing) |
Convenience method for setting the spacing of the SlicedGeometry3D instances of all time steps. More... | |
![]() | |
BaseProperty::ConstPointer | GetConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) const override |
Get property by its key. More... | |
std::vector< std::string > | GetPropertyKeys (const std::string &contextName="", bool includeDefaultContext=false) const override |
Query keys of existing properties. More... | |
std::vector< std::string > | GetPropertyContextNames () const override |
Query names of existing contexts. More... | |
BaseProperty * | GetNonConstProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) override |
Get property by its key. More... | |
void | SetProperty (const std::string &propertyKey, BaseProperty *property, const std::string &contextName="", bool fallBackOnDefaultContext=false) override |
Add new or change existent property. More... | |
void | RemoveProperty (const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=false) override |
Removes a property. If the property does not exist, nothing will be done. More... | |
const mitk::TimeGeometry * | GetTimeGeometry () const |
Return the TimeGeometry of the data as const pointer. More... | |
const mitk::TimeGeometry * | GetTimeSlicedGeometry () const |
Return the TimeGeometry of the data as const pointer. More... | |
mitk::TimeGeometry * | GetTimeGeometry () |
Return the TimeGeometry of the data as pointer. More... | |
const mitk::TimeGeometry * | GetUpdatedTimeGeometry () |
Return the TimeGeometry of the data. More... | |
const mitk::TimeGeometry * | GetUpdatedTimeSliceGeometry () |
Return the TimeGeometry of the data. More... | |
const mitk::BaseGeometry * | GetUpdatedGeometry (int t=0) |
Return the BaseGeometry of the data at time t. More... | |
mitk::BaseGeometry * | GetGeometry (int t=0) const |
Return the geometry, which is a TimeGeometry, of the data as non-const pointer. More... | |
void | UpdateOutputInformation () override |
Update the information for this BaseData (the geometry in particular) so that it can be used as an output of a BaseProcess. More... | |
void | CopyInformation (const itk::DataObject *data) override |
Copy information from the specified data set. More... | |
virtual bool | IsInitialized () const |
Check whether the data has been initialized, i.e., at least the Geometry and other header data has been set. More... | |
virtual bool | IsEmptyTimeStep (unsigned int t) const |
Check whether object contains data (at a specified time), e.g., a set of points may be empty. More... | |
virtual bool | IsEmpty () const |
Check whether object contains data (at least at one point in time), e.g., a set of points may be empty. More... | |
void | ExecuteOperation (Operation *operation) override |
overwrite if the Data can be called by an Interactor (StateMachine). More... | |
virtual void | SetTimeGeometry (TimeGeometry *geometry) |
Set the TimeGeometry of the data, which will be referenced (not copied!). More... | |
virtual void | SetClonedGeometry (const BaseGeometry *aGeometry3D) |
Set a clone of the provided Geometry as Geometry of the data. Assumes the data object has only 1 time step ( is a 3D object ) and creates a new TimeGeometry. If an TimeGeometry has already been set for the object, it will be replaced after calling this function. More... | |
virtual void | SetClonedTimeGeometry (const TimeGeometry *geometry) |
Set a clone of the provided TimeGeometry as TimeGeometry of the data. More... | |
virtual void | SetClonedGeometry (const BaseGeometry *aGeometry3D, unsigned int time) |
Set a clone of the provided geometry as BaseGeometry of a given time step. More... | |
mitk::PropertyList::Pointer | GetPropertyList () const |
Get the data's property list. More... | |
void | SetPropertyList (PropertyList *propertyList) |
Set the data's property list. More... | |
mitk::BaseProperty::Pointer | GetProperty (const char *propertyKey) const |
Get the property (instance of BaseProperty) with key propertyKey from the PropertyList, and set it to this, respectively;. More... | |
void | SetProperty (const char *propertyKey, BaseProperty *property) |
itk::SmartPointer< mitk::BaseDataSource > | GetSource () const |
Get the process object that generated this data object. More... | |
unsigned int | GetTimeSteps () const |
Get the number of time steps from the TimeGeometry As the base data has not a data vector given by itself, the number of time steps is defined over the time sliced geometry. In sub classes, a better implementation could be over the length of the data vector. More... | |
unsigned long | GetMTime () const override |
Get the modified time of the last change of the contents this data object or its geometry. More... | |
void | Graft (const DataObject *) override |
![]() | |
itkTypeMacroNoParent (OperationActor) virtual ~OperationActor() | |
![]() | |
Identifiable () | |
Identifiable (const UIDType &uid) | |
Identifiable (const Identifiable &)=delete | |
Identifiable (Identifiable &&) noexcept | |
virtual | ~Identifiable () |
Identifiable & | operator= (const Identifiable &)=delete |
Identifiable & | operator= (Identifiable &&other) noexcept |
UIDType | GetUID () const |
Get unique ID of an object. More... | |
![]() | |
~IPropertyOwner () override | |
![]() | |
virtual | ~IPropertyProvider () |
Static Public Member Functions | |
static Pointer | New () |
![]() | |
static const char * | GetStaticNameOfClass () |
static Pointer | New () |
![]() | |
static const char * | GetStaticNameOfClass () |
![]() | |
static const char * | GetStaticNameOfClass () |
Public Attributes | |
Message | BeforeChangeLayerEvent |
BeforeChangeLayerEvent (e.g. used for GUI integration) As soon as active labelset should be changed, the signal emits. Emitted by SetActiveLayer(int layer);. More... | |
Message | AfterChangeLayerEvent |
AfterchangeLayerEvent (e.g. used for GUI integration) As soon as active labelset was changed, the signal emits. Emitted by SetActiveLayer(int layer);. More... | |
Protected Member Functions | |
mitkCloneMacro (Self) | |
LabelSetImage () | |
LabelSetImage (const LabelSetImage &other) | |
~LabelSetImage () override | |
template<typename ImageType1 , typename ImageType2 > | |
void | ChangeLayerProcessing (ImageType1 *source, ImageType2 *target) |
template<typename TPixel , unsigned int VImageDimension> | |
void | LayerContainerToImageProcessing (itk::Image< TPixel, VImageDimension > *source, unsigned int layer) |
template<typename TPixel , unsigned int VImageDimension> | |
void | ImageToLayerContainerProcessing (itk::Image< TPixel, VImageDimension > *source, unsigned int layer) const |
template<typename ImageType > | |
void | CalculateCenterOfMassProcessing (ImageType *input, PixelType index, unsigned int layer) |
template<typename ImageType > | |
void | ClearBufferProcessing (ImageType *input) |
template<typename ImageType > | |
void | EraseLabelProcessing (ImageType *input, PixelType index, unsigned int layer) |
template<typename ImageType > | |
void | MergeLabelProcessing (ImageType *input, PixelType pixelValue, PixelType index) |
template<typename ImageType > | |
void | ConcatenateProcessing (ImageType *input, mitk::LabelSetImage *other) |
template<typename ImageType > | |
void | MaskStampProcessing (ImageType *input, mitk::Image *mask, bool forceOverwrite) |
template<typename LabelSetImageType , typename ImageType > | |
void | InitializeByLabeledImageProcessing (LabelSetImageType *input, ImageType *other) |
![]() | |
virtual itk::LightObject::Pointer | InternalClone () const override |
int | GetSliceIndex (int s=0, int t=0, int n=0) const |
int | GetVolumeIndex (int t=0, int n=0) const |
void | ComputeOffsetTable () |
virtual bool | IsValidTimeStep (int t) const |
void | Expand (unsigned int timeSteps) override |
Expands the TimeGeometry to a number of TimeSteps. More... | |
virtual ImageDataItemPointer | AllocateSliceData (int s=0, int t=0, int n=0, void *data=nullptr, ImportMemoryManagementType importMemoryManagement=CopyMemory) const |
virtual ImageDataItemPointer | AllocateVolumeData (int t=0, int n=0, void *data=nullptr, ImportMemoryManagementType importMemoryManagement=CopyMemory) const |
virtual ImageDataItemPointer | AllocateChannelData (int n=0, void *data=nullptr, ImportMemoryManagementType importMemoryManagement=CopyMemory) const |
Image () | |
Image (const Image &other) | |
~Image () override | |
void | Clear () override |
Calls ClearData() and InitializeEmpty();. More... | |
void | Initialize () override |
void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
![]() | |
SlicedData () | |
SlicedData (const SlicedData &other) | |
~SlicedData () override | |
![]() | |
BaseData () | |
BaseData (const BaseData &other) | |
~BaseData () override | |
virtual void | InitializeTimeGeometry (unsigned int timeSteps=1) |
Initialize the TimeGeometry for a number of time steps. The TimeGeometry is initialized empty and evenly timed. In many cases it will be necessary to overwrite this in sub-classes. More... | |
virtual void | InitializeTimeSlicedGeometry (unsigned int timeSteps=1) |
Initialize the TimeGeometry for a number of time steps. The TimeGeometry is initialized empty and evenly timed. In many cases it will be necessary to overwrite this in sub-classes. More... | |
virtual void | ClearData () |
reset to non-initialized state, release memory More... | |
virtual void | InitializeEmpty () |
Pure virtual; Must be used in subclasses to get a data object to a valid state. Should at least create one empty object and call Superclass::InitializeTimeGeometry() to ensure an existing valid geometry. More... | |
void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
Protected Attributes | |
std::vector< LabelSet::Pointer > | m_LabelSetContainer |
std::vector< Image::Pointer > | m_LayerContainer |
int | m_ActiveLayer |
bool | m_activeLayerInvalid |
mitk::Label::Pointer | m_ExteriorLabel |
![]() | |
ImageDataItemPointerArray | m_Channels |
ImageDataItemPointerArray | m_Volumes |
ImageDataItemPointerArray | m_Slices |
itk::SimpleFastMutexLock | m_ImageDataArraysLock |
unsigned int | m_Dimension |
unsigned int * | m_Dimensions |
ImageDescriptor::Pointer | m_ImageDescriptor |
vcl_size_t * | m_OffsetTable |
ImageDataItemPointer | m_CompleteData |
StatisticsHolderPointer | m_ImageStatistics |
![]() | |
RegionType | m_LargestPossibleRegion |
RegionType | m_RequestedRegion |
bool | m_RequestedRegionInitialized |
RegionType | m_BufferedRegion |
bool | m_UseLargestPossibleRegion |
![]() | |
bool | m_LastRequestedRegionWasOutsideOfTheBufferedRegion |
unsigned int | m_SourceOutputIndexDuplicate |
bool | m_Initialized |
Additional Inherited Members | |
![]() | |
typedef itk::MutexLockHolder< itk::SimpleFastMutexLock > | MutexHolder |
LabelSetImage class for handling labels and layers in a segmentation session.
Handles operations for adding, removing, erasing and editing labels and layers.
Definition at line 29 of file mitkLabelSetImage.h.
Definition at line 33 of file mitkLabelSetImage.h.
|
protected |
Definition at line 63 of file mitkLabelSetImage.cpp.
References mitk::DICOMSegmentationPropertyHelper::DeriveDICOMSegmentationProperties(), m_ExteriorLabel, and mitk::Label::New().
|
protected |
Definition at line 80 of file mitkLabelSetImage.cpp.
References mitk::Image::Clone(), mitk::DICOMSegmentationPropertyHelper::DeriveDICOMSegmentationProperties(), GetLabelSet(), GetLayerImage(), GetNumberOfLayers(), m_LabelSetContainer, m_LayerContainer, and OnLabelSetModified().
|
overrideprotected |
Definition at line 158 of file mitkLabelSetImage.cpp.
References m_LabelSetContainer.
void mitk::LabelSetImage::AddLabelSetToLayer | ( | const unsigned int | layerIdx, |
const mitk::LabelSet::Pointer | labelSet | ||
) |
Add a LabelSet to an existing layer.
This will replace an existing labelSet if one exists. Throws an exceptions if you are trying to add a labelSet to a non-existing layer.
If there are no labelSets for layers with an id less than layerIdx default ones will be added for them.
layerIdx | The index of the layer the LabelSet should be added to |
labelSet | The LabelSet that should be added |
Definition at line 273 of file mitkLabelSetImage.cpp.
References GetExteriorLabel(), m_LabelSetContainer, m_LayerContainer, mitkThrow, and mitk::LabelSet::New().
unsigned int mitk::LabelSetImage::AddLayer | ( | mitk::LabelSet::Pointer | layer = nullptr | ) |
Adds a new layer to the LabelSetImage. The new layer will be set as the active one.
layer | a mitk::LabelSet which will be set as new layer. |
Definition at line 212 of file mitkLabelSetImage.cpp.
References AccessByItk, AccessFixedDimensionByItk, mitk::Image::Clone(), mitk::Image::GetDimension(), mitk::Image::GetDimensions(), mitk::Image::GetImageDescriptor(), mitk::SlicedData::GetNumberOfChannels(), mitk::Image::GetPixelType(), mitk::BaseData::GetTimeGeometry(), mitk::Image::New(), and SetToZero().
Referenced by Initialize(), and InitializeByLabeledImageProcessing().
unsigned int mitk::LabelSetImage::AddLayer | ( | mitk::Image::Pointer | layerImage, |
mitk::LabelSet::Pointer | lset = nullptr |
||
) |
Add a layer based on a provided mitk::Image.
layerImage | is added to the vector of label images |
lset | a label set that will be added to the new layer if provided |
Definition at line 235 of file mitkLabelSetImage.cpp.
References GetExteriorLabel(), ls, m_LabelSetContainer, m_LayerContainer, mitk::LabelSet::New(), OnLabelSetModified(), and SetActiveLayer().
|
protected |
Definition at line 744 of file mitkLabelSetImage.cpp.
References mitk::LabelSet::GetLabel(), GetLabelSet(), mitk::SlicedData::GetSlicedGeometry(), mitk::BaseGeometry::IndexToWorld(), mitk::Label::SetCenterOfMassCoordinates(), and mitk::Label::SetCenterOfMassIndex().
Referenced by UpdateCenterOfMass().
|
protected |
void mitk::LabelSetImage::ClearBuffer | ( | ) |
Definition at line 385 of file mitkLabelSetImage.cpp.
References AccessByItk, ClearBufferProcessing(), and mitkThrow.
|
protected |
Definition at line 786 of file mitkLabelSetImage.cpp.
Referenced by ClearBuffer().
void mitk::LabelSetImage::Concatenate | ( | mitk::LabelSetImage * | image | ) |
Definition at line 352 of file mitkLabelSetImage.cpp.
References AccessByItk_1, mitk::LabelSet::AddLabel(), ConcatenateProcessing(), mitk::Image::GetDimensions(), GetLabelSet(), GetNumberOfLayers(), mitk::LabelSet::IteratorConstBegin(), mitk::LabelSet::IteratorConstEnd(), ls, mitkThrow, and SetActiveLayer().
|
protected |
Definition at line 793 of file mitkLabelSetImage.cpp.
References mitk::CastToItkImage(), GetActiveLayer(), GetLabel(), and GetNumberOfLabels().
Referenced by Concatenate().
mitk::Image::Pointer mitk::LabelSetImage::CreateLabelMask | ( | PixelType | index, |
bool | useActiveLayer = true , |
||
unsigned int | layer = 0 |
||
) |
Definition at line 571 of file mitkLabelSetImage.cpp.
References CreateLabelMaskProcessing(), GetActiveLayer(), mitk::ImageWriteAccessor::GetData(), mitk::Image::GetDimension(), mask, mitkThrow, mitk::Image::New(), and SetActiveLayer().
Referenced by QmitkLabelSetWidget::UpdateControls().
void mitk::LabelSetImage::EraseLabel | ( | PixelType | pixelValue, |
unsigned int | layer = 0 |
||
) |
Erases the label with the given value in the given layer from the underlying image. The label itself will not be erased from the respective mitk::LabelSet. In order to remove the label itself use mitk::LabelSetImage::RemoveLabels()
pixelValue | the label which will be remove from the image |
layer | the layer in which the label should be removed |
Definition at line 465 of file mitkLabelSetImage.cpp.
References AccessByItk_2, EraseLabelProcessing(), and mitkThrow.
Referenced by EraseLabels(), RemoveLabels(), and QmitkLabelSetWidget::~QmitkLabelSetWidget().
|
protected |
Definition at line 873 of file mitkLabelSetImage.cpp.
Referenced by EraseLabel().
void mitk::LabelSetImage::EraseLabels | ( | std::vector< PixelType > & | VectorOfLabelPixelValues, |
unsigned int | layer = 0 |
||
) |
Similar to mitk::LabelSetImage::EraseLabel() this funtion erase a list of labels from the image.
VectorOfLabelPixelValues | the list of labels that should be remove |
layer | the layer for which the labels should be removed |
Definition at line 457 of file mitkLabelSetImage.cpp.
References EraseLabel().
Referenced by QmitkLabelSetWidget::~QmitkLabelSetWidget().
bool mitk::LabelSetImage::ExistLabel | ( | PixelType | pixelValue | ) | const |
Returns true if the value exists in one of the labelsets.
Definition at line 398 of file mitkLabelSetImage.cpp.
References GetNumberOfLayers(), and m_LabelSetContainer.
Referenced by InitializeByLabeledImageProcessing().
bool mitk::LabelSetImage::ExistLabel | ( | PixelType | pixelValue, |
unsigned int | layer | ||
) | const |
Checks if a label exists in a certain layer.
pixelValue | the label value |
layer | the layer in which should be searched for the label |
Definition at line 406 of file mitkLabelSetImage.cpp.
References m_LabelSetContainer.
bool mitk::LabelSetImage::ExistLabelSet | ( | unsigned int | layer | ) | const |
Returns true if the labelset exists.
Definition at line 412 of file mitkLabelSetImage.cpp.
References m_LabelSetContainer.
mitk::Label * mitk::LabelSetImage::GetActiveLabel | ( | unsigned int | layer = 0 | ) |
Returns the active label of a specific layer.
layer | the layer ID for which the active label should be returned |
Definition at line 478 of file mitkLabelSetImage.cpp.
References m_LabelSetContainer.
Referenced by MaskStampProcessing(), mitk::PaintbrushTool::MouseMoved(), mitk::SetRegionTool::OnMouseReleased(), and QmitkLabelSetWidget::ResetAllTableWidgetItems().
mitk::LabelSet * mitk::LabelSetImage::GetActiveLabelSet | ( | ) |
Returns the currently active mitk::LabelSet.
Definition at line 510 of file mitkLabelSetImage.cpp.
References GetActiveLayer(), and m_LabelSetContainer.
Referenced by QmitkLabelSetWidget::GetLabelStringList(), InitializeByLabeledImageProcessing(), QmitkLabelSetWidget::ResetAllTableWidgetItems(), QmitkLabelSetWidget::SetDataStorage(), QmitkLabelSetWidget::SetOrganColors(), and QmitkLabelSetWidget::~QmitkLabelSetWidget().
unsigned int mitk::LabelSetImage::GetActiveLayer | ( | ) | const |
Gets the ID of the currently active layer.
Definition at line 173 of file mitkLabelSetImage.cpp.
References m_ActiveLayer.
Referenced by ConcatenateProcessing(), CreateLabelMask(), mitk::Equal(), GetActiveLabelSet(), InitializeByLabeledImageProcessing(), MaskStampProcessing(), RemoveLayer(), QmitkLabelSetWidget::ResetAllTableWidgetItems(), SetActiveLayer(), QmitkLabelSetWidget::SetOrganColors(), QmitkLabelSetWidget::UpdateAllTableWidgetItems(), QmitkLabelSetWidget::UpdateControls(), and QmitkLabelSetWidget::~QmitkLabelSetWidget().
mitk::Label * mitk::LabelSetImage::GetExteriorLabel | ( | ) |
Gets the mitk::Label which is used as default exterior label.
Definition at line 115 of file mitkLabelSetImage.cpp.
References m_ExteriorLabel.
Referenced by AddLabelSetToLayer(), AddLayer(), and mitk::ContourModelUtils::FillSliceInSlice().
const mitk::Label * mitk::LabelSetImage::GetExteriorLabel | ( | ) | const |
Definition at line 120 of file mitkLabelSetImage.cpp.
References m_ExteriorLabel.
mitk::Label * mitk::LabelSetImage::GetLabel | ( | PixelType | pixelValue, |
unsigned int | layer = 0 |
||
) | const |
Returns the mitk::Label with the given pixelValue and for the given layer.
pixelValue | the pixel value of the label |
layer | the layer in which the labels should be located |
Definition at line 486 of file mitkLabelSetImage.cpp.
References m_LabelSetContainer.
Referenced by ConcatenateProcessing(), QmitkLabelSetWidget::GetLabelStringList(), MaskStampProcessing(), QmitkLabelSetWidget::SetDataStorage(), QmitkLabelSetWidget::SetOrganColors(), QmitkLabelSetWidget::UpdateAllTableWidgetItems(), QmitkLabelSetWidget::UpdateControls(), and QmitkLabelSetWidget::~QmitkLabelSetWidget().
mitk::LabelSet * mitk::LabelSetImage::GetLabelSet | ( | unsigned int | layer = 0 | ) |
Gets the mitk::LabelSet for the given layer.
layer | the layer for which the mitk::LabelSet should be retrieved |
Definition at line 494 of file mitkLabelSetImage.cpp.
References m_LabelSetContainer.
Referenced by CalculateCenterOfMassProcessing(), Concatenate(), mitk::DICOMSegmentationPropertyHelper::DeriveDICOMSegmentationProperties(), mitk::Equal(), InitializeByLabeledImageProcessing(), LabelSetImage(), MergeLabel(), MergeLabels(), mitk::DICOMSegmentationIO::Read(), RemoveLabels(), and RemoveLayer().
const mitk::LabelSet * mitk::LabelSetImage::GetLabelSet | ( | unsigned int | layer = 0 | ) | const |
Definition at line 502 of file mitkLabelSetImage.cpp.
References m_LabelSetContainer.
mitk::Image * mitk::LabelSetImage::GetLayerImage | ( | unsigned int | layer | ) |
Definition at line 163 of file mitkLabelSetImage.cpp.
References m_LayerContainer.
Referenced by mitk::Equal(), and LabelSetImage().
const mitk::Image * mitk::LabelSetImage::GetLayerImage | ( | unsigned int | layer | ) | const |
Definition at line 168 of file mitkLabelSetImage.cpp.
References m_LayerContainer.
unsigned int mitk::LabelSetImage::GetNumberOfLabels | ( | unsigned int | layer = 0 | ) | const |
Get the number of all existing mitk::Labels for a given layer.
layer | the layer ID for which the active mitk::Labels should be retrieved |
Definition at line 530 of file mitkLabelSetImage.cpp.
References m_LabelSetContainer.
Referenced by ConcatenateProcessing(), InitializeByLabeledImageProcessing(), and QmitkLabelSetWidget::ResetAllTableWidgetItems().
unsigned int mitk::LabelSetImage::GetNumberOfLayers | ( | ) | const |
Definition at line 178 of file mitkLabelSetImage.cpp.
References m_LabelSetContainer.
Referenced by Concatenate(), mitk::DICOMSegmentationPropertyHelper::DeriveDICOMSegmentationProperties(), mitk::Equal(), ExistLabel(), LabelSetImage(), SetActiveLayer(), and mitk::ShowSegmentationAsSurface::ThreadedUpdateFunction().
unsigned int mitk::LabelSetImage::GetTotalNumberOfLabels | ( | ) | const |
Returns the number of all labels summed up across all layers.
Definition at line 535 of file mitkLabelSetImage.cpp.
References m_LabelSetContainer.
Referenced by mitk::Equal().
|
protected |
Definition at line 847 of file mitkLabelSetImage.cpp.
References m_LayerContainer.
Referenced by SetActiveLayer().
|
overridevirtual |
initialize new (or re-initialize) image information by another mitk-image. Only the header is used, not the data vector!
Reimplemented from mitk::Image.
Definition at line 125 of file mitkLabelSetImage.cpp.
References AccessByItk, AccessFixedDimensionByItk, AddLayer(), mitk::TimeGeometry::Clone(), mitk::DICOMQIPropertyHelper::DeriveDICOMSourceProperties(), mitk::Image::GetDimension(), mitk::Image::GetDimensions(), mitk::BaseData::GetTimeGeometry(), mitk::BaseData::SetTimeGeometry(), and SetToZero().
void mitk::LabelSetImage::InitializeByLabeledImage | ( | mitk::Image::Pointer | image | ) |
Initialize a new mitk::LabelSetImage by an given image. For all distinct pixel values of the parameter image new labels will be created. If the number of distinct pixel values exceeds mitk::Label::MAX_LABEL_VALUE a new layer will be created.
image | the image which is used for initialization |
Definition at line 619 of file mitkLabelSetImage.cpp.
References AccessTwoImagesFixedDimensionByItk, mitk::ImageWriteAccessor::GetData(), mitk::Image::Initialize(), InitializeByLabeledImageProcessing(), mitkThrow, and mitk::BaseData::SetTimeGeometry().
|
protected |
Definition at line 662 of file mitkLabelSetImage.cpp.
References mitk::LabelSet::AddLabel(), AddLayer(), ExistLabel(), GetActiveLabelSet(), GetActiveLayer(), GetLabelSet(), GetNumberOfLabels(), m_LabelSetContainer, mitk::Label::MAX_LABEL_VALUE, and mitk::Label::New().
Referenced by InitializeByLabeledImage().
|
protected |
Definition at line 822 of file mitkLabelSetImage.cpp.
References m_LayerContainer.
Referenced by SetActiveLayer().
void mitk::LabelSetImage::MaskStamp | ( | mitk::Image * | mask, |
bool | forceOverwrite | ||
) |
Definition at line 544 of file mitkLabelSetImage.cpp.
References AccessByItk_2, MaskStampProcessing(), mitkThrow, and mitk::PadImageFilter::New().
Referenced by QmitkMaskStampWidget::OnStamp().
|
protected |
Definition at line 710 of file mitkLabelSetImage.cpp.
References mitk::CastToItkImage(), GetActiveLabel(), GetActiveLayer(), GetLabel(), and mitk::Label::GetValue().
Referenced by MaskStamp().
void mitk::LabelSetImage::MergeLabel | ( | PixelType | pixelValue, |
PixelType | sourcePixelValue, | ||
unsigned int | layer = 0 |
||
) |
Merges the mitk::Label with a given target value with the active label.
pixelValue | the value of the label that should be the new merged label |
sourcePixelValue | the value of the label that should be merged into the specified one |
layer | the layer in which the merge should be performed |
Definition at line 417 of file mitkLabelSetImage.cpp.
References AccessByItk_2, GetLabelSet(), MergeLabelProcessing(), mitkThrow, and mitk::LabelSet::SetActiveLabel().
Referenced by QmitkLabelSetWidget::~QmitkLabelSetWidget().
|
protected |
Definition at line 893 of file mitkLabelSetImage.cpp.
Referenced by MergeLabel(), and MergeLabels().
void mitk::LabelSetImage::MergeLabels | ( | PixelType | pixelValue, |
std::vector< PixelType > & | vectorOfSourcePixelValues, | ||
unsigned int | layer = 0 |
||
) |
Merges a list of mitk::Labels with the mitk::Label that has a specific value.
pixelValue | the value of the label that should be the new merged label |
vectorOfSourcePixelValues | the list of label values that should be merge into the specified one |
layer | the layer in which the merge should be performed |
Definition at line 431 of file mitkLabelSetImage.cpp.
References AccessByItk_2, GetLabelSet(), MergeLabelProcessing(), mitkThrow, and mitk::LabelSet::SetActiveLabel().
Referenced by QmitkLabelSetWidget::~QmitkLabelSetWidget().
mitk::LabelSetImage::mitkClassMacro | ( | LabelSetImage | , |
Image | |||
) |
|
protected |
|
static |
Referenced by mitk::OtsuTool3D::ConfirmSegmentation(), mitk::ConvertImageToLabelSetImage(), ConvertImageToLabelSetImage(), mitk::Tool::CreateEmptySegmentationNode(), mitk::WatershedTool::DoIt(), mitk::BooleanOperation::GetResult(), main(), mitk::LabelSetImageSource::MakeOutput(), mitk::DICOMSegmentationIO::Read(), mitk::OtsuTool3D::RunSegmentation(), and mitk::PickingTool::StartRegionGrowing().
void mitk::LabelSetImage::OnLabelSetModified | ( | ) |
Definition at line 105 of file mitkLabelSetImage.cpp.
Referenced by AddLayer(), and LabelSetImage().
void mitk::LabelSetImage::RemoveLabels | ( | std::vector< PixelType > & | VectorOfLabelPixelValues, |
unsigned int | layer = 0 |
||
) |
Removes labels from the mitk::LabelSet of given layer. Calls mitk::LabelSetImage::EraseLabels() which also removes the labels from within the image.
VectorOfLabelPixelValues | a list of labels to be removed |
layer | the layer in which the labels should be removed |
Definition at line 448 of file mitkLabelSetImage.cpp.
References EraseLabel(), GetLabelSet(), and mitk::LabelSet::RemoveLabel().
Referenced by QmitkLabelSetWidget::~QmitkLabelSetWidget().
void mitk::LabelSetImage::RemoveLayer | ( | ) |
Removes the active layer and the respective mitk::LabelSet and image information. The new active layer is the one below, if exists.
Definition at line 183 of file mitkLabelSetImage.cpp.
References GetActiveLayer(), GetLabelSet(), m_activeLayerInvalid, m_LabelSetContainer, m_LayerContainer, and SetActiveLayer().
void mitk::LabelSetImage::SetActiveLayer | ( | unsigned int | layer | ) |
Definition at line 298 of file mitkLabelSetImage.cpp.
References AccessByItk_1, AccessFixedDimensionByItk_n, AfterChangeLayerEvent, BeforeChangeLayerEvent, GetActiveLayer(), mitk::Image::GetDimension(), GetNumberOfLayers(), ImageToLayerContainerProcessing(), LayerContainerToImageProcessing(), m_ActiveLayer, m_activeLayerInvalid, mitkThrow, and mitk::Message< A >::Send().
Referenced by AddLayer(), Concatenate(), CreateLabelMask(), RemoveLayer(), and mitk::DICOMSegmentationIO::Write().
void mitk::LabelSetImage::SetExteriorLabel | ( | mitk::Label * | label | ) |
Sets the label which is used as default exterior label when creating a new layer.
label | the label which will be used as new exterior label |
Definition at line 110 of file mitkLabelSetImage.cpp.
References m_ExteriorLabel.
void mitk::LabelSetImage::UpdateCenterOfMass | ( | PixelType | pixelValue, |
unsigned int | layer = 0 |
||
) |
Definition at line 518 of file mitkLabelSetImage.cpp.
References AccessByItk_2, AccessFixedDimensionByItk_2, CalculateCenterOfMassProcessing(), and mitk::Image::GetDimension().
Referenced by QmitkLabelSetWidget::SetDataStorage(), and QmitkLabelSetWidget::SetOrganColors().
Message mitk::LabelSetImage::AfterChangeLayerEvent |
AfterchangeLayerEvent (e.g. used for GUI integration) As soon as active labelset was changed, the signal emits. Emitted by SetActiveLayer(int layer);.
Definition at line 49 of file mitkLabelSetImage.h.
Referenced by SetActiveLayer().
Message mitk::LabelSetImage::BeforeChangeLayerEvent |
BeforeChangeLayerEvent (e.g. used for GUI integration) As soon as active labelset should be changed, the signal emits. Emitted by SetActiveLayer(int layer);.
Definition at line 42 of file mitkLabelSetImage.h.
Referenced by SetActiveLayer().
|
protected |
Definition at line 309 of file mitkLabelSetImage.h.
Referenced by GetActiveLayer(), and SetActiveLayer().
|
protected |
Definition at line 311 of file mitkLabelSetImage.h.
Referenced by RemoveLayer(), and SetActiveLayer().
|
protected |
Definition at line 313 of file mitkLabelSetImage.h.
Referenced by GetExteriorLabel(), LabelSetImage(), and SetExteriorLabel().
|
protected |
Definition at line 306 of file mitkLabelSetImage.h.
Referenced by AddLabelSetToLayer(), AddLayer(), ExistLabel(), ExistLabelSet(), GetActiveLabel(), GetActiveLabelSet(), GetLabel(), GetLabelSet(), GetNumberOfLabels(), GetNumberOfLayers(), GetTotalNumberOfLabels(), InitializeByLabeledImageProcessing(), LabelSetImage(), RemoveLayer(), and ~LabelSetImage().
|
protected |
Definition at line 307 of file mitkLabelSetImage.h.
Referenced by AddLabelSetToLayer(), AddLayer(), GetLayerImage(), ImageToLayerContainerProcessing(), LabelSetImage(), LayerContainerToImageProcessing(), and RemoveLayer().