38 std::vector<std::string> names;
39 names.push_back(name);
40 return DC3dDToMatrixXd(dc, names, mask);
48 int numberOfNames = names.size();
51 std::vector<DataIterType> dataIter;
53 for (
int i = 0; i < numberOfNames; ++i)
55 DataIterType iter(dc, names[i]);
56 dataIter.push_back(iter);
59 Eigen::MatrixXd result(numberOfVoxels, names.size());
65 for (
int col = 0; col < numberOfNames; ++col)
67 result(row,col) = dataIter[col].GetVoxel();
71 for (
int col = 0; col < numberOfNames; ++col)
82 std::vector<std::string> names;
83 names.push_back(name);
84 return DC3dDToMatrixXi(dc, names, mask);
92 int numberOfNames = names.size();
95 std::vector<DataIterType> dataIter;
97 for (
int i = 0; i < numberOfNames; ++i)
99 DataIterType iter(dc, names[i]);
100 dataIter.push_back(iter);
103 Eigen::MatrixXi result(numberOfVoxels, names.size());
110 for (
int col = 0; col < numberOfNames; ++col)
112 result(row,col) = dataIter[col].GetVoxel();
116 for (
int col = 0; col < numberOfNames; ++col)
129 int numberOfNames = names.size();
132 std::vector<DataIterType> dataIter;
134 for (
int i = 0; i < numberOfNames; ++i)
136 EnsureDoubleImageInDC(dc,names[i],mask);
137 DataIterType iter(dc, names[i]);
138 dataIter.push_back(iter);
146 for (
int col = 0; col < numberOfNames; ++col)
148 dataIter[col].SetVoxel(matrix(row,col));
152 for (
int col = 0; col < numberOfNames; ++col)
164 int numberOfNames = names.size();
167 std::vector<DataIterType> dataIter;
169 for (
int i = 0; i < numberOfNames; ++i)
171 EnsureUCharImageInDC(dc,names[i],mask);
172 DataIterType iter(dc, names[i]);
173 dataIter.push_back(iter);
181 for (
int col = 0; col < numberOfNames; ++col)
183 (dataIter[col]).SetVoxel(matrix(row,col));
187 for (
int col = 0; col < numberOfNames; ++col)
197 std::vector<std::string> names;
198 names.push_back(name);
199 return MatrixToDC3d(matrix, dc, names, mask);
204 std::vector<std::string> names;
205 names.push_back(name);
206 return MatrixToDC3d(matrix, dc, names, mask);
212 typedef itk::Image<unsigned char, 3> LabelImage;
220 if (dc->HasElement(origin))
222 LabelImage::Pointer originImage =
dynamic_cast<LabelImage*
>(dc->GetData(origin).GetPointer());
224 if (!dc->HasElement(name) && originImage.IsNotNull())
226 MITK_INFO <<
"New unsigned char image necessary";
228 image->SetRegions(originImage->GetLargestPossibleRegion());
229 image->SetSpacing(originImage->GetSpacing());
230 image->SetOrigin(originImage->GetOrigin());
231 image->SetDirection(originImage->GetDirection());
233 image->FillBuffer(0);
235 dc->AddData(dynamic_cast<itk::DataObject*>(image.GetPointer()),name,
"");
238 for (std::size_t i = 0; i < dc->Size();++i)
243 EnsureUCharImageInDC(newCol, name, origin);
251 typedef itk::Image<unsigned char, 3> LabelImage;
259 if (dc->HasElement(origin))
261 LabelImage::Pointer originImage =
dynamic_cast<LabelImage*
>(dc->GetData(origin).GetPointer());
262 if (!dc->HasElement(name) && originImage.IsNotNull())
264 MITK_INFO <<
"New double image necessary";
266 image->SetRegions(originImage->GetLargestPossibleRegion());
267 image->SetSpacing(originImage->GetSpacing());
268 image->SetOrigin(originImage->GetOrigin());
269 image->SetDirection(originImage->GetDirection());
272 dc->AddData(dynamic_cast<itk::DataObject*>(image.GetPointer()),name,
"");
275 for (std::size_t i = 0; i < dc->Size();++i)
280 EnsureDoubleImageInDC(newCol, name, origin);
itk::Image< mitk::ScalarType, 3 > FeatureImage
itk::SmartPointer< Self > Pointer
static void EnsureDoubleImageInDC(mitk::DataCollection::Pointer dc, std::string name, std::string origin)
static void EnsureUCharImageInDC(mitk::DataCollection::Pointer dc, std::string name, std::string origin)
static void MatrixToDC3d(const Eigen::MatrixXd &matrix, mitk::DataCollection::Pointer dc, const std::vector< std::string > &names, std::string mask)
static Eigen::MatrixXi DC3dDToMatrixXi(mitk::DataCollection::Pointer dc, std::string name, std::string mask)
static Eigen::MatrixXd DC3dDToMatrixXd(mitk::DataCollection::Pointer dc, std::string names, std::string mask)
static int VoxelInMask(mitk::DataCollection::Pointer dc, std::string mask)
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.