14 #ifndef mitkDataCollectionUtility_h
15 #define mitkDataCollectionUtility_h
28 class DataCollectionUtility
31 template <
class OriginImageType,
class TargetImageType>
37 std::string blub =
"haha";
38 typedef itk::Image<double, 3> ImType;
39 EnsureImageInCollection<ImType, ImType>(col, blub, blub);
43 template <
class OriginImageType,
class TargetImageType>
47 typedef typename TargetImageType FeatureImage;
48 typedef typename OriginImageType LabelImage;
50 if (collection->HasElement(origin))
52 LabelImage::Pointer originImage =
dynamic_cast<LabelImage*
>(collection->GetData(origin).GetPointer());
53 if (!collection->HasElement(target) && originImage.IsNotNull())
55 FeatureImage::Pointer image = FeatureImage::New();
56 image->SetRegions(originImage->GetLargestPossibleRegion());
57 image->SetSpacing(originImage->GetSpacing());
58 image->SetOrigin(originImage->GetOrigin());
59 image->SetDirection(originImage->GetDirection());
62 collection->AddData(
dynamic_cast<itk::DataObject*
>(image.GetPointer()),target,
"");
65 for (std::size_t i = 0; i < collection->Size();++i)
70 EnsureDataImageInCollection(newCol, origin, target);