[vtkusers] What's wrong with my codes? (convert image to BMP)

Jeremy Winston winston at cat.rpi.edu
Wed Mar 5 08:07:44 EST 2003


vince xu wrote:
> I want to convert the files quarter.1 --> quarter.1.bmp
> quarter.2 --> quarter.2.bmp
> quarter.3 --> quarter.3.bmp
> [...]
>     reader = vtkImageReader::New();
>     reader->SetDataByteOrderToBigEndian();
>     reader->SetDataExtent(0, 63, 0, 63, 1, 93);
>     reader->SetFilePrefix(fname);
>     reader->SetFilePattern("%s.%d");
>     reader->SetDataSpacing(3.2, 3.2, 1.5);
> //    reader->SetDataScalarTypeToUnsignedChar();
> [...]
> If I delete the "//" in the program,then I can get BMP files.
> But the files are blurred.
> 
> Whats wrong with my codes? How could I get clear files?
> (Images stored in quarter.* are clear)

I think the data spacing is (1,1,1), not (3.2,3.2,1.5).
If you stretch it out that way, it's not surprising it
gets blurry.

-Jeremy(That's my guess, anyway)





More information about the vtkusers mailing list