[Insight-users] Problem while disconnecting pipeline

Martijn Steenwijk martijnsteenwijk at gmail.com
Wed Sep 7 13:25:06 EDT 2011


Dear all,

 

I would like to use an input image two times, so I have to Disconnect the
pipeline. My pipeline is like this.

 

ReaderType::Pointer reader = ReaderType::New();

reader->SetFileName(myFile);

reader->Update();

 

// Create a binary mask of the input image

typedef itk::BinaryThresholdImageFilter<ImageType,BinaryImageType>
BinaryThresholdImageFilterType;

BinaryThresholdImageFilterType::Pointer thresholdFilter =
BinaryThresholdImageFilterType::New();

thresholdFilter->SetInput(reader->GetOutput());

thresholdFilter->SetUpperThreshold(0.0000);

thresholdFilter->SetInsideValue(0);

thresholdFilter->SetOutsideValue(255);

////

//  some other filters

////

ImageType::Pointer filteredImage = myFilterN->GetOutput();

filteredImage->DisconnectPipeline();

 

typedef itk::ImageFileWriter<ImageType>                 ImageWriterType;

ImageWriterType::Pointer writer = ImageWriterType::New();

writer->SetFileName(myOutFile);

writer->SetInput(reader->GetOutput());             // for debug purposes,
just write the reader->Output();

writer->Update();

 

Unfortunately the written image does not contain the input image, but the
output of myFilterN (filteredImage), which means, something gets wrong with
disconnecting the pipeline. How can I fix this?

 

Best,

Martijn

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110907/7c4b4a5a/attachment.htm>


More information about the Insight-users mailing list