Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
#include <mitkRandomParcellationGenerator.h>
Public Types | |
typedef itk::Image< TPixel, VImageDimension > | ImageType |
Public Member Functions | |
void | SetImage (itk::Image< TPixel, VImageDimension > *) |
void | SetNumberNodes (int inputNumberNodes) |
void | SetVariablesForMerging (int givenSizeOfSmallestRegion, int desiredNumberOfParcels, int givenSizeOfSmallestRegionBeginning) |
void | SetBoolsForMerging (bool mergingWithNumberParcels, bool mergingWithSmallestParcel, bool justMergeSmallParcels) |
void | GetRandomSeedVoxels () |
Sets randomly chosen seed voxels (1x1x1 regions) on the segmented image This is done by creating a vector with unique values, which represents the position of a voxel respectively. For this purpose we count all voxels with value one and choose random numbers. More... | |
void | ParcelGrowthOverFaces () |
Add appropriate voxels of the segmented part to a region (just 6-connected neighborhood) A voxel is appropriate if the cost function value is high enough. Several constraints have to be fulfilled for this purpose. More... | |
void | FillOverEdgeOrVertex () |
Add voxels of the segmented part to an appropriate region (26-connected neighborhood) Checks which voxels still have value one and to which neighborhood-region each one should be added. More... | |
void | AllocateIsolatedVoxels () |
Add voxels of the segmented part to an appropriate region (no neighbors necessary) Checks which voxels still have value one and calculates the distance to all parcels. Finally each voxel is added to the region with the smallest distance to it. More... | |
int | MergeParcels () |
Merge parcels according to a cost function Looks for the parcel with the smallest number of voxels. Then merges it to a neighborhood-parcel such that the cost function value is small enough. The new number of nodes is returned so we can show them on the GUI. More... | |
void | SetAppropriateValues () |
Changes the values of the nodes, such that no gaps exist and it starts with value 1. More... | |
void | ShowSizeOfRegions () |
Calculates and shows the size (number of voxels) of all regions on the console. More... | |
Protected Types | |
typedef itk::ImageRegion< 3 > | RegionType |
Protected Member Functions | |
std::vector< double > | GetCenterOfMass (itk::ImageRegionIterator< ImageType > it_region, int valueOfRegion, bool getSizeOfRegions) |
Gives back the center of mass and -if wanted- the size (number of voxels) of a parcel. More... | |
double | GetDistance (std::vector< double > centerOfMass, typename ImageType::IndexType indexNewVoxel) |
Calculates the distance between two voxels, the position of the first one is given by an index and the position of the second one is given by a vector. More... | |
double | GetDistanceVector (std::vector< double > centerOfMass, std::vector< double > indexNewVoxel) |
Calculates the distance between two voxels, both positions are given by vectors. More... | |
int | SmallestValue (std::vector< int > distance) |
Gives back the smallest value of an int-vector. More... | |
double | SmallestValue (std::vector< double > distance) |
Gives back the smallest value of a double-vector. More... | |
ImageType::RegionType | ExtendedRegion (typename ImageType::RegionType chosenRegion, typename ImageType::IndexType indexChosenVoxel) |
Extends the region if the chosen voxel lies outside. More... | |
ImageType::RegionType | ExtendedRegionNotNeighbor (typename ImageType::RegionType chosenRegion, typename ImageType::RegionType smallestRegion) |
Extends the region of a parcel such that the second region lies within. More... | |
bool | IsUnique (int number, std::vector< int > vec) |
Checks if a number is an element of the vector already. More... | |
void | GetSizeOfRegions () |
Calculates the size (number of voxels) of all regions. More... | |
Protected Attributes | |
std::vector< std::pair< RegionType, int > > | m_EvenRegions |
std::vector< std::pair< RegionType, int > > | m_OddRegions |
std::vector< std::pair< RegionType, int > > | m_InvalidRegions |
std::vector< int > | m_SizeOfRegions |
std::vector< int > | m_SizeOfFinishedRegions |
ImageType * | m_Image |
int | m_NumberNodes |
int | m_GivenSizeOfSmallestRegion |
int | m_DesiredNumberOfParcels |
int | m_GivenSizeOfSmallestRegionBeginning |
bool | m_MergingWithNumberParcels |
bool | m_MergingWithSmallestParcel |
bool | m_JustMergeSmallParcels |
Definition at line 42 of file mitkRandomParcellationGenerator.h.
typedef itk::Image< TPixel, VImageDimension > mitk::RandomParcellationGenerator< TPixel, VImageDimension >::ImageType |
Definition at line 45 of file mitkRandomParcellationGenerator.h.
|
protected |
Definition at line 105 of file mitkRandomParcellationGenerator.h.
void mitk::RandomParcellationGenerator< TPixel, VImageDimension >::AllocateIsolatedVoxels | ( | ) |
Add voxels of the segmented part to an appropriate region (no neighbors necessary) Checks which voxels still have value one and calculates the distance to all parcels. Finally each voxel is added to the region with the smallest distance to it.
Definition at line 736 of file mitkRandomParcellationGenerator.cpp.
References MITK_DEBUG, mitk::RegionVoxelCounter< TPixel, VImageDimension >::SetImage(), mitk::RegionVoxelCounter< TPixel, VImageDimension >::SetRegion(), mitk::RegionVoxelCounter< TPixel, VImageDimension >::VoxelWithValue(), and xrand().
|
protected |
Extends the region if the chosen voxel lies outside.
Definition at line 244 of file mitkRandomParcellationGenerator.cpp.
|
protected |
Extends the region of a parcel such that the second region lies within.
Definition at line 277 of file mitkRandomParcellationGenerator.cpp.
void mitk::RandomParcellationGenerator< TPixel, VImageDimension >::FillOverEdgeOrVertex | ( | ) |
Add voxels of the segmented part to an appropriate region (26-connected neighborhood) Checks which voxels still have value one and to which neighborhood-region each one should be added.
Definition at line 618 of file mitkRandomParcellationGenerator.cpp.
References MITK_DEBUG, mitk::RegionVoxelCounter< TPixel, VImageDimension >::SetImage(), mitk::RegionVoxelCounter< TPixel, VImageDimension >::SetRegion(), mitk::RegionVoxelCounter< TPixel, VImageDimension >::VoxelWithValue(), and xrand().
|
protected |
Gives back the center of mass and -if wanted- the size (number of voxels) of a parcel.
Definition at line 72 of file mitkRandomParcellationGenerator.cpp.
|
protected |
Calculates the distance between two voxels, the position of the first one is given by an index and the position of the second one is given by a vector.
Definition at line 117 of file mitkRandomParcellationGenerator.cpp.
|
protected |
Calculates the distance between two voxels, both positions are given by vectors.
Definition at line 129 of file mitkRandomParcellationGenerator.cpp.
void mitk::RandomParcellationGenerator< TPixel, VImageDimension >::GetRandomSeedVoxels | ( | ) |
Sets randomly chosen seed voxels (1x1x1 regions) on the segmented image This is done by creating a vector with unique values, which represents the position of a voxel respectively. For this purpose we count all voxels with value one and choose random numbers.
Definition at line 372 of file mitkRandomParcellationGenerator.cpp.
References mitk::RegionVoxelCounter< TPixel, VImageDimension >::SetImage(), mitk::RegionVoxelCounter< TPixel, VImageDimension >::SetRegion(), mitk::RegionVoxelCounter< TPixel, VImageDimension >::VoxelWithValue(), and xrand().
|
protected |
Calculates the size (number of voxels) of all regions.
Definition at line 1164 of file mitkRandomParcellationGenerator.cpp.
References mitk::RegionVoxelCounter< TPixel, VImageDimension >::SetImage(), mitk::RegionVoxelCounter< TPixel, VImageDimension >::SetRegion(), and mitk::RegionVoxelCounter< TPixel, VImageDimension >::VoxelWithValue().
|
protected |
Checks if a number is an element of the vector already.
Definition at line 359 of file mitkRandomParcellationGenerator.cpp.
int mitk::RandomParcellationGenerator< TPixel, VImageDimension >::MergeParcels | ( | ) |
Merge parcels according to a cost function Looks for the parcel with the smallest number of voxels. Then merges it to a neighborhood-parcel such that the cost function value is small enough. The new number of nodes is returned so we can show them on the GUI.
Definition at line 850 of file mitkRandomParcellationGenerator.cpp.
void mitk::RandomParcellationGenerator< TPixel, VImageDimension >::ParcelGrowthOverFaces | ( | ) |
Add appropriate voxels of the segmented part to a region (just 6-connected neighborhood) A voxel is appropriate if the cost function value is high enough. Several constraints have to be fulfilled for this purpose.
Definition at line 446 of file mitkRandomParcellationGenerator.cpp.
References mitk::CostFunctionBase< TPixel, VImageDimension >::CalculateCost(), mitk::CostFunctionBase< TPixel, VImageDimension >::MaximalValue(), mitk::CostFunctionBase< TPixel, VImageDimension >::SetImage(), mitk::CostFunctionBase< TPixel, VImageDimension >::SetRegion(), and xrand().
void mitk::RandomParcellationGenerator< TPixel, VImageDimension >::SetAppropriateValues | ( | ) |
Changes the values of the nodes, such that no gaps exist and it starts with value 1.
Definition at line 174 of file mitkRandomParcellationGenerator.cpp.
References offset.
void mitk::RandomParcellationGenerator< TPixel, VImageDimension >::SetBoolsForMerging | ( | bool | mergingWithNumberParcels, |
bool | mergingWithSmallestParcel, | ||
bool | justMergeSmallParcels | ||
) |
Definition at line 61 of file mitkRandomParcellationGenerator.cpp.
void mitk::RandomParcellationGenerator< TPixel, VImageDimension >::SetImage | ( | itk::Image< TPixel, VImageDimension > * | image | ) |
Definition at line 41 of file mitkRandomParcellationGenerator.cpp.
void mitk::RandomParcellationGenerator< TPixel, VImageDimension >::SetNumberNodes | ( | int | inputNumberNodes | ) |
Definition at line 47 of file mitkRandomParcellationGenerator.cpp.
void mitk::RandomParcellationGenerator< TPixel, VImageDimension >::SetVariablesForMerging | ( | int | givenSizeOfSmallestRegion, |
int | desiredNumberOfParcels, | ||
int | givenSizeOfSmallestRegionBeginning | ||
) |
Definition at line 53 of file mitkRandomParcellationGenerator.cpp.
void mitk::RandomParcellationGenerator< TPixel, VImageDimension >::ShowSizeOfRegions | ( | ) |
Calculates and shows the size (number of voxels) of all regions on the console.
Definition at line 1177 of file mitkRandomParcellationGenerator.cpp.
References MITK_DEBUG, mitk::RegionVoxelCounter< TPixel, VImageDimension >::SetImage(), mitk::RegionVoxelCounter< TPixel, VImageDimension >::SetRegion(), and mitk::RegionVoxelCounter< TPixel, VImageDimension >::VoxelWithValue().
|
protected |
Gives back the smallest value of an int-vector.
Definition at line 142 of file mitkRandomParcellationGenerator.cpp.
|
protected |
Gives back the smallest value of a double-vector.
Definition at line 158 of file mitkRandomParcellationGenerator.cpp.
|
protected |
Definition at line 117 of file mitkRandomParcellationGenerator.h.
|
protected |
Definition at line 107 of file mitkRandomParcellationGenerator.h.
|
protected |
Definition at line 116 of file mitkRandomParcellationGenerator.h.
|
protected |
Definition at line 118 of file mitkRandomParcellationGenerator.h.
|
protected |
Definition at line 114 of file mitkRandomParcellationGenerator.h.
|
protected |
Definition at line 109 of file mitkRandomParcellationGenerator.h.
|
protected |
Definition at line 121 of file mitkRandomParcellationGenerator.h.
|
protected |
Definition at line 119 of file mitkRandomParcellationGenerator.h.
|
protected |
Definition at line 120 of file mitkRandomParcellationGenerator.h.
|
protected |
Definition at line 115 of file mitkRandomParcellationGenerator.h.
|
protected |
Definition at line 108 of file mitkRandomParcellationGenerator.h.
|
protected |
Definition at line 112 of file mitkRandomParcellationGenerator.h.
|
protected |
Definition at line 110 of file mitkRandomParcellationGenerator.h.