[Insight-users] file writer/reader problem

k s smythek at u.washington.edu
Wed May 17 22:37:23 EDT 2006


Hello,

I am having trouble overwriting a file that I've already written out to.  It
gives an "unable to open file" error when I try something like the
pseudocode below:

I have a writerType Pointer writer,
	 a readerType reader, and
	 two ImageType InputFile, Outputfile.

After 

reader->SetFileName(InputFile);

I perform some filtering, say 

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

Then I write that out using 

writer->SetFileName(Outputfile);, and do 
writer->SetInput(filter->GetOutput());

No problems so far...
But then I perform another filter, say
reader->SetFileName(Outputfile);
reader->GetOutput();
filter2->SetInput(reader->GetOutput());

This doesn't error either, but when I try to do 

writer->SetInput(filter2->GetOutput());

I get an error from the ImageIO (TIFF in my case) saying it cannot open
Outputfile.  I just want to overwrite the previous image I created and I
can't seem to figure out how to do it.  The Software Guide doesn't have this
sort of thing; can anyone help me out?

Thanks!

Kathy



More information about the Insight-users mailing list