[Insight-users] Problem while disconnecting pipeline

Martijn Steenwijk martijnsteenwijk at gmail.com
Wed Sep 7 15:11:23 EDT 2011


Yes, sorry forgot to copy that part.


On Wed, Sep 7, 2011 at 7:56 PM, robert tamburo <robert.tamburo at gmail.com>wrote:

> Are you calling update on the filter before setting the image to the filter
> output?
>
> On Wed, Sep 7, 2011 at 1:25 PM, Martijn Steenwijk <
> martijnsteenwijk at gmail.com> wrote:
>
>> 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****
>>
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.html
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110907/18e6a6f7/attachment.htm>


More information about the Insight-users mailing list