Hi Nancy,
 I think I know what it is.

In any case, this is how it should work:

A) in general vmtk will use ITK to read images, and it will do so unless you 
manually specify -useitk 0 on the vmtkimagereader.
The syntax for reading in the standard way is

vmtkimagereader -ifile E:\VTK\VTK-5.8\vtkdata-5.8.0\Data\BlueCircle.png --pipe 
vmtkimageviewer

ITK will take care of recognizing the format automatically. In this case you 
can shorten it simply to

vmtkimageviewer -ifile E:\VTK\VTK-5.8\vtkdata-5.8.0\Data\BlueCircle.png

There's a but: ITK, although it's a better choice for medical image formats, 
can only read 1 channel png's so if you want to read a 
3 channel image you have to use B)


B) the alternative is to use VTK to read image files. This is how you do it:

vmtkimagereader -useitk 0 -f png -ifile 
E:\VTK\VTK-5.8\vtkdata-5.8.0\Data\BlueCircle.png -d   --pipe vmtkimageviewer


Note that in the pipes above I haven't used the -d option at all: the filename 
should be complete with the full path (E:\VTK...). This
is very likely the issue you were having with your script.


Now, the syntax for reading DICOM is the following 

vmtkimagereader -ifile E:\DICOM\SERIES_1\IM0001 --pipe vmtkimageviewer

where I just made up a path. The path should specify the first file in the 
DICOM series you're interested in.

A clarification with the -d option: it's for reading file series (DICOM, png, 
etc) using the VTK readers. You should use it coupled 
with the -prefix and -pattern options for non-DICOM data. For DICOM data, -f 
dicom -d E:\DICOM\SERIES_1 suffices, no need of 
-prefix and -pattern. However, using the VTK DICOM reader is discouraged in 
favor of ITK, as shown above.

Hope this helps


Luca

PS: one unrelated suggestion, you can omit the .py at the end of script names 
(vmtkimagereader -ifile ... instead of vmtkimagereader.py -ifile ...).



On Nov 28, 2012, at 2:26 AM, Nancy wrote:

> Hi ,
> i had installated vmtk and pythonxy ,now i want to take a test,but i met some 
> problems.For example:
> 1、 i want to open E:\VTK\VTK-5.8\vtkdata-5.8.0\Data\BlueCircle.png
> <截图1.png>
> 、
> i type in cmd :
>  vmtkimagereader.py -f png -ifile BlueCircle.png -d 
> E:\VTK\VTK-5.8\vtkdata-5.8.0\Data  --pipe vmtkimageviewer.py
> get result :
> <截图2.png>
>  
> 2、if i try to open dicom picture ,there are also errors like this:
> <截图3.png>
> <截图4.png>
>  
> Do you know this is why?
> how do i do?
>  
> Regards,
> 
> 
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel: 
> INSIGHTS What's next for parallel hardware, programming and related areas?
> Interviews and blogs by thought leaders keep you ahead of the curve.
> http://goparallel.sourceforge.net_______________________________________________
> vmtk-users mailing list
> vmtk-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/vmtk-users

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
BUILD Helping you discover the best ways to construct your parallel projects.
http://goparallel.sourceforge.net
_______________________________________________
vmtk-users mailing list
vmtk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vmtk-users

Reply via email to