18 #ifndef mitkDataCollectionUtilit_h
19 #define mitkDataCollectionUtilit_h
32 class DataCollectionUtility
35 template <
class OriginImageType,
class TargetImageType>
41 std::string blub =
"haha";
42 typedef itk::Image<double, 3> ImType;
43 EnsureImageInCollection<ImType, ImType>(col, blub, blub);
47 template <
class OriginImageType,
class TargetImageType>
52 typedef typename OriginImageType LabelImage;
54 if (collection->HasElement(origin))
56 LabelImage::Pointer originImage =
dynamic_cast<LabelImage*
>(collection->GetData(origin).GetPointer());
57 if (!collection->HasElement(target) && originImage.IsNotNull())
60 image->SetRegions(originImage->GetLargestPossibleRegion());
61 image->SetSpacing(originImage->GetSpacing());
62 image->SetOrigin(originImage->GetOrigin());
63 image->SetDirection(originImage->GetDirection());
66 collection->AddData(dynamic_cast<itk::DataObject*>(image.GetPointer()),target,
"");
69 for (std::size_t i = 0; i < collection->Size();++i)
81 #endif //mitkDataCollectionUtilit_h
itk::Image< mitk::ScalarType, 3 > FeatureImage
itk::SmartPointer< Self > Pointer
DataCollection - Class to facilitate loading/accessing structured data.
static void EnsureDataImageInCollection(mitk::DataCollection::Pointer collection, std::string origin, std::string target)
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.