[Insight-users] Re: Image Format

Luis Ibanez luis . ibanez at kitware . com
Wed, 23 Jul 2003 13:30:11 -0400


Hi P3,

1) The notion of image spacing
is described in the SoftwareGuide
http://www . itk . org/ItkSoftwareGuide . pdf
Section 4.1.4, pdf-page 54.

It is the separation in millimeters
between the centers of consecutive
pixels along each dimension. Note
that we say millimeters just because
it is the usual measure in medical
imaging, but you could actually use
the number for representing any other
unit.

2) yes, open the header file using
    the fltk GUI applications

3) if the files expected by slicer
    are simply raw files, you could
    use the 'tail' unix command for
    extracting the last past of the
    PGM which actually contains the
    binary pixel data.  You will have
    to compute the amounts of bytes
    to extract, using the image size
    and the number of bytes per pixel.



Regards,



    Luis


-------------------------------------

perdigao wrote:
> Thanks I already have the pgm files
> 
> 3 questions
> 
> 1) how should I adopt the spacing information, what did this information
> tell me? You write 1 1 1 , that does this mean?
> 
> 2) and then I should run/open the header in the SEfltkGui application?
> 
> 3) I am also using the 3d slicer that uses the files .001....00N...
> 
> Can I convert this pgm files in .001 ...  .00N?
> 
> What is the instruction to do that?
> 
> 
> Thanks a lot once again.
> P3
> 
> 
> 
> 
> -----Original Message-----
> From: Luis Ibanez [mailto:luis . ibanez at kitware . com] 
> Sent: quarta-feira, 23 de Julho de 2003 1:58
> To: p3rdigao
> Cc: cates at sci . utah . edu; insight-users at itk . org
> Subject: Re: [Insight-users] Re: Image Format
> 
> Hi P3rdigao,
> 
> Please  do  the following
> 
> 0)   cd  to the directory where your tiff images are
> 
> 1)  mogrify  -format pgm    pelvis*.tiff
> 
> 2) then adapt the attached MetaImage header file
>     in order to add all the pgm files you have.
>    Note that you will have to fix the spacing in
>    this header, as well as the number of slices in Z
>    according to the number of files you add at the
>    bottom.
> 
> You should be able to open this MetaImage header
> with the new version of the Segmentation editor
> available in
> 
> InsightApplications/SegmentationEditorFltkGui
> 
> Please beware that your slices are quite large
> (1415x1407), so the total volume  may have
> a respectful size.
> 
> 
> Regards,
> 
> 
>   Luis
> 
> 
> ------------------
> p3rdigao wrote:
> 
> 
>>-----Original Message-----
>>
>>From: p3rdigao [mailto:p3rdigao at civil . ist . utl . pt
> 
> <mailto:p3rdigao at civil . ist . utl . pt> ] 
> 
>>Sent: quarta-feira, 23 de Julho de 2003 1:22
>>
>>To: 'Joshua Cates'
>>
>>Subject: RE: [Insight-users] Re: Image Format
>>
>>I already intalled ImageMagic, then run convert like this
>>
>>C:\ convert pélvis1.tiff pelvis.001
>>
>>It creates the file but deep inside nothing occurs, because if you use
> 
> notepad the file inside stills the same....if fact if RENAME to
> pelvis1.tiff you are able to view the image
> 
>>Which means it stills as an header file..
>>
>>Am I forgeting some flag in [options]...
>>
>>There is another way ???
>>
>>the first sugestion I dont get it!
>>
>>I sendo you an original file pelvis.tiff that i want to convert to
> 
> pelvis.001
> 
>>It is extremely urgent!!!
>>
>>
>>
>>Thanks a lot once again!
>>
>>
>>
>>
>>
>>Hi P3rdigao,
>>
>>In the SegmentationEditor application, the data
>>
>>is being read using VTK.
>>
>>You can specify a "sprintf" pattern for generating
>>
>>the filenames of the slices in a sequence.
>>
>>This program assumes that your slices are raw
>>
>>data stored one slice per file.
>>
>>If you need to convert your slices from .gif,
>>
>>.tiff, or .bmp into raw, you may want to use
>>
>>the ImageMagick tools. In particular:
>>
>>
>>
>>1) "convert" will convert the files one by one
>>
>>2) "mogrify" will convert all of them at once
>>
>>If you are running in Windows, please be careful
>>
>>since there is a system utility "convert" that
>>
>>will transform your file system into NT, so make
>>
>>sure that you are running the binary from
>>
>>ImageMagick and not the system tool.
>>
>>
>>
>>Regards,
>>
>>
>>
>>Luis
>>
>>
>>
>>---------------
>>
>>p3rdigao wrote:
>>
>> 
>>
>>
>>>Hi
>>>   
>>>
>>
>> 
>>
>>
>> 
>>
>>
>>>In the tumorbase (the brain) used for the Segmentation Editor example,
>>
> 
>>>   
>>>
>>
>> 
>>
>>
>>>the image data have extension *.01, *.02, *.03 and so on
>>>   
>>>
>>
>> 
>>
>>
>> 
>>
>>
>>>My question is: In my own image files that are *.gif, *.tiff , 
>>>   
>>>
>>
>> 
>>
>>
>>>*.bmp....how do I converte them to *.01...*.0n ?
>>>   
>>>
>>
>> 
>>
>>
>> 
>>
>>
>>>Thanks a lot
>>>   
>>>
>>
>> 
>>
>>
>>>p3
>>>   
>>>
>>
>> 
>>
>>
>> 
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> 
>>
> 
> 
> 
> 
>