29 template<
typename TPixel>
31 const ::itk::Index<3> index,
41 value =
static_cast<double>(readAccess.GetPixelByIndex(idx));
46 value =
static_cast<double>(readAccess.GetPixelByIndex(index));
51 value =
static_cast<double>(readAccess.GetPixelByIndex(index));
54 MITK_DEBUG <<
"Voxel [" << index[0] <<
", " << index[1] <<
", " << index[2] <<
", " << timestep
61 const mitk::Point3D& position,
unsigned int timestep,
bool noThrow)
68 if (geometry.IsNull())
73 geometry->WorldToIndex(position, index);
75 return ReadVoxel(image, index, timestep, noThrow);
80 const ::itk::Index<3> &index,
unsigned int timestep,
bool noThrow)
94 catch (
const std::exception& e)
98 MITK_ERROR <<
"Exception in ReadVoxel (index: " << index <<
"; timestep: " << timestep <<
"). Reason: " << e.what();
106 MITK_ERROR <<
"Unknown exception in ReadVoxel (index: " << index <<
"; timestep: " << timestep <<
").";
120 mitkThrow() <<
"Cannot extract parameter value map out of model fit instance. Passed model fit instance is a null ptr.";
142 const ::itk::Index<3> &index)
146 mitkThrow() <<
"Cannot extract parameter value map out of model fit instance. Passed model fit instance is a null ptr.";
169 if (!pTraitInterface)
171 mitkThrow() <<
"Cannot convert parameter values. Passed traits interface is a null ptr.";
180 for (
const auto& name : paramNameVector)
182 ParameterValueMapType::const_iterator iter = valueMap.find(name);
184 if (iter != valueMap.end())
186 paramArray[paramIndex] = iter->second;
191 mitkThrow() <<
"Cannot convert parameter values. Parameter name ('" << name <<
"') is missing in value map.";
MITKMODELFIT_EXPORT ModelTraitsInterface::ParameterValueType ReadVoxel(const mitk::Image *image, const mitk::Point3D &position, unsigned int timestep=0, bool noThrow=true)
Gives locked and index-based read access for a particular image part. The class provides several set-...
virtual ImageDataItemPointer GetSliceData(int s=0, int t=0, int n=0, void *data=nullptr, ImportMemoryManagementType importMemoryManagement=CopyMemory) const
MITKMODELFIT_EXPORT ModelTraitsInterface::ParametersType ConvertParameterMapToParameterVector(const ParameterValueMapType &valueMap, const ModelTraitsInterface *pTraitInterface)
const mitk::PixelType GetPixelType(int n=0) const
Returns the PixelType of channel n.
ParametersType::SizeValueType ParametersSizeType
std::map< ModelTraitsInterface::ParameterNameType, double > ParameterValueMapType
itk::Array< ParameterValueType > ParametersType
const mitk::TimeGeometry * GetTimeGeometry() const
Return the TimeGeometry of the data as const pointer.
std::vector< ParameterNameType > ParameterNamesType
Data class that stores all information about a modelfit parameter. Such a parameter is going to be fi...
unsigned int GetDimension() const
Get dimension of the image.
virtual ParameterNamesType GetParameterNames() const =0
virtual ImageDataItemPointer GetVolumeData(int t=0, int n=0, void *data=nullptr, ImportMemoryManagementType importMemoryManagement=CopyMemory) const
Image class for storing images.
#define mitkPixelTypeMultiplex4(function, ptype, param1, param2, param3, param4)
mitk::Image::Pointer image
Data class that stores all information about a modelfit that is relevant to the visualization and sto...
MITKMODELFIT_EXPORT ParameterValueMapType ExtractParameterValueMapFromModelFit(const mitk::modelFit::ModelFitInfo *fitInfo, const mitk::Point3D &position)
virtual BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const =0
Returns the geometry which corresponds to the given time step.
double ParameterValueType
ParamListType::const_iterator ConstIterType
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...
const ParamListType & GetParameters() const
mitk::Image::ConstPointer image
Class for defining the data type of pixels.