[vtkusers] vtkVolume16Reader, How to read raw files f rom 002.dcm.raw to 123.dcm.raw?

Obada Mahdi omahdi at googlemail.com
Mon Dec 25 09:47:54 EST 2006


Hello,

On 12/25/06, iii-lin <iii-lin at 163.com> wrote:
>    I use dicom2 to convert 002.dcm....123.dcm to
> 002.dcm.raw....123.dcm.raw,and use the vtkVolume16Reader to read the raw
> files,but the v16.SetFilePattern("%s%3d.dcm.raw") has something wrong, In
> the output window:can not find d:\rawdata\  2.dcm.raw ,how to set the
> patterns?Let d:\rawdata\002.dcm.raw could be readed.

your format string is missing the '0' flag, for including leading
zeros instead of padding the specified width with spaces:

| v16.SetFilePattern("%s%03d.dcm.raw")

This is not VTK-specific, the format strings work like in the printf()
family of functions.


HTH,

Obada



More information about the vtkusers mailing list