[Insight-users] DicomSeriesReadImageWrite program arguments

Luis Ibanez luis.ibanez at kitware.com
Thu, 19 Feb 2004 04:18:49 -0500


Hi Michael,

Software works better when you compile it.    :-)

If you take an example from version 1.6,
please also update to ITK version 1.6
and... rebuilt it.

--

The error message that you get indicates simply
that the filename that you provided for writing
the output volume is not recognized by ITK.

The ImageFileWriter relies on the file extension
for determining the fileformat to be used.

The FAQ entry
http://www.itk.org/cgi-bin/InsightFAQ/InsightFAQ?req=show&file=faq01.007.htp
describes the formats currently supported by ITK
along with the extension expected for their
filenames.  You may want to use MetaImage or
Analyze formats.

So, instead of just "volume" in the command line
arguments, put "volume.mhd" (for MetaImage format)
or "volume.hdr" (for Analyze) or "volume.vtk" (for
VTK format).


Regards,


    Luis


--------------------
a a wrote:
> Hi Luis,
>  
> i've done what you said but there are some error when running the 
> example, below is the command line and the error. I've built ITK 1.40, 
> but this example was extracted from ITK 1.60(without building 1.60), is 
> that the problem? i've also attached the CMakeCache.txt just in case.
>  
> Thanks
> Regards
> Michael
>  
> ******************************************************************
> volume is the argument for the output file
> ******************************************************************
> C:\example1\Debug>DicomSeriesReadImageWrite.exe C:\dicom_images\mdata volume
>   1.3.12.2.1107.5.2.4.7368.20031130124720000021
> The directory:
> C:\dicom_images\mdata
> Contains the following DICOM Series:
> 1.3.12.2.1107.5.2.4.7368.20031130124720000021
> 1.3.12.2.1107.5.2.4.7368.20031130124823000022
> 1.3.12.2.1107.5.2.4.7368.20031130124917000023
> 1.3.12.2.1107.5.2.4.7368.20031130125016000024
> 1.3.12.2.1107.5.2.4.7368.20031130125111000025
> 1.3.12.2.1107.5.2.4.7368.20031130125215000026
> 1.3.12.2.1107.5.2.4.7368.20031130125304000027
> 1.3.12.2.1107.5.2.4.7368.20031130125358000028
> 1.3.12.2.1107.5.2.4.7368.20031130125453000029
> 1.3.12.2.1107.5.2.4.7368.20031130125546000030
> 1.3.12.2.1107.5.2.4.7368.20031130125646000031
> 1.3.12.2.1107.5.2.4.7368.20031130125741000032
> 1.3.12.2.1107.5.2.4.7368.20031130125839000033
> 
> Now reading series:
> 1.3.12.2.1107.5.2.4.7368.20031130124720000021
> 
> Writing the image as
> volume.txt
> 
> itk::ExceptionObject (00E9F938)
> Location: "Unknown"
> File: C:\ITK\src\Code\IO\itkImageFileWriter.txx
> Line: 143
> Description: itk::ERROR: ImageFileWriter(015164F0): No ImageIO set, or 
> none could be created.
> 
> 
> */Luis Ibanez <luis.ibanez at kitware.com>/* wrote:
> 
> 
>     Hi Michael,
> 
>     This example reads DICOM files from a directory,
>     create a volume with them and write the volume
>     to a file.
> 
>     If you look at the code, you will find that the
>     expected arguments are:
> 
>     1) Directory where your dicom files are
>     2) Filename of for the output volume
>     3) DICOM Series to select
> 
>     Parameter (3) is needed because the directory (1) may
>     contain several different DICOM series. If you don't
>     provide any string for argument (3), then the first
>     series available in the directory is taken by default.
> 
> 
>     IMPORTANT: DO NOT USE DIRECTORIES WITH SPACES !
> 
>     There are many places in which filename parsing is
>     done naively and spaces will be taken as string
>     terminators.
> 
>     e.g.: "C:\Documents and Settings" is a particularly
>     *bad* place for putting your data.
> 
> 
> 
>     Regards,
> 
> 
>     Luis
> 
> 
>     --------------
>     a a wrote:
> 
>      > Hi to all,
>      >
>      > i was trying out the DicomSeriesReadImageWrite.cxx file, but i'm not
>      > sure of the program arguments to enter. i went to the project
>      > settings/Debug in VC++ and in the program arguments, i entered this:
>      > C:/Documents and Settings/...../Images for argv[1] where Images
>     is the
>      > folder for the dicom files. However, i'm not sure what to enter
>     for the
>      > other 2 arguments, can someone show me how? (C:/Documents and
>      > Settings/...../Images ; ...... ; .............)
>      >
>      > What does this DicomSeriesReader do exactly: Load a Dicom Series and
>      > output them in some other format?
>      > i have a set of images for the tongue, i suppose each dicom series
>      > includes images acquired for one slice for a number of time
>     frames, so
>      > how can i load the images as a volume( all the slices in frame 1
>     or all
>      > slices in frame 2...) and stack them up according to their slice
>     position?
>      >
>      > Thank you so much for helping
>      > with Best Regards
>      > Michael
>      >
> 
>