itk copy a image

来源:互联网 发布:软件源代码管理流程图 编辑:程序博客网 时间:2024/05/17 00:12

template<class TInputImage>
class itk::ImageDuplicator< TInputImage >

A helper class which creates an image which is perfect copy of the input image.

This class is NOT a filter. Although it has an API similar to a filter, this class is not intended to be used in a pipeline. Instead, the typical use will be like it is illustrated in the following code:

medianFilter->Update();
ImageType::Pointer image = medianFilter->GetOutput();
typedefitk::ImageDuplicator< ImageType > DuplicatorType;
DuplicatorType::Pointer duplicator = DuplicatorType::New();
duplicator->SetInputImage(image);
duplicator->Update();
ImageType::Pointer clonedImage = duplicator->GetModifiableOutput();

Note that the Update() method must be called explicitly in the filter that provides the input to the ImageDuplicator object. This is needed because the ImageDuplicator is not a pipeline filter.

原创粉丝点击