[Insight-users] Re: Insight-users Digest, Vol 46, Issue 16

Karl Fritscher karl.fritscher at umit.at
Fri Feb 8 04:49:27 EST 2008


insight-users-request at itk.org schrieb:
> Send Insight-users mailing list submissions to
> 	insight-users at itk.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://www.itk.org/mailman/listinfo/insight-users
> or, via email, send a message with subject or body 'help' to
> 	insight-users-request at itk.org
>
> You can reach the person managing the list at
> 	insight-users-owner at itk.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Insight-users digest..."
>   
> ------------------------------------------------------------------------
>
> Today's Topics:
>
>    1. A bug in itkAnalyzeImageIO? (Jian Wu)
>    2. writing space units information in a NRRD file (Francois Budin)
>    3. Re: A bug in itkAnalyzeImageIO? (Bill Lorensen)
>    4. Re: Compiling itk 3.4 with Borland C++ v5.5 (Walter Cabrera)
>    5. Re: Compiling itk 3.4 with Borland C++ v5.5 (Luis Ibanez)
>    6. Re: A bug in itkAnalyzeImageIO? (Jian Wu)
>   
>
> ------------------------------------------------------------------------
>
> Betreff:
> [Insight-users] A bug in itkAnalyzeImageIO?
> Von:
> Jian Wu <eewujian at yahoo.com>
> Datum:
> Thu, 7 Feb 2008 11:25:45 -0800 (PST)
> An:
> insight-users at itk.org
>
> An:
> insight-users at itk.org
>
>
> Hi,
> I'm doing image format conversion from other image types to Analyze 7.5. The program did not give me any error message. However I doubt it may not handle the image header information properly. The images I generated in Analyze 7.5 format can be viewed using MRIcro image viewer. But when I tried to opened it using Matlab function analyze75read, it gave me an error message "Reference to non-existent field 'ImgDataType'." I studies the ITK source code and found out the line 1128 of itkAnalyzeImageIO.cxx states:
>     switch( this->m_Hdr.dime.datatype)
> Here "this->m_Hdr" has not been filled with proper image information yet when the input image is not in Analyze image format. I think "this->m_ComponentType" should be referred instead. My test code is attached here. I used "brainweb1e1a10f20.mha" as the input image.
>
> Jian
>
> Command line:
> ImageReadWriteAnalyze brainweb1e1a10f20.mha brainweb1e1a10f20.img
>
> Source Code:
>
> /*=========================================================================
>
>   Program:   Insight Segmentation & Registration Toolkit
>   Module:    $ ImageReadWriteAnalyze.cxx $
>   Language:  C++
>   Date:      $Date: 2008/02/07 $
>   Version:   $Revision: 1.0 $
>   Author:     Jian Wu
>
> =========================================================================*/
> #if defined(_MSC_VER)
> #pragma warning ( disable : 4786 )
> #endif
>
> #ifdef __BORLANDC__
> #define ITK_LEAN_AND_MEAN
> #endif
>
> #include "itkImageFileReader.h"
> #include "itkImageFileWriter.h"
> #include "itkAnalyzeImageIO.h"
>
> #include "itkImage.h"
>
>
> int main( int argc, char ** argv )
> {
>   if( argc < 3 )
>     {
>     std::cerr << "Usage: " << std::endl;
>     std::cerr << argv[0] << " inputImageFile  outputImageFile " << std::endl;
>     return EXIT_FAILURE;
>     }
>
>   typedef unsigned short      PixelType;
>   const   unsigned int        Dimension = 3;
>   typedef itk::Image< PixelType, Dimension >    ImageType;
>
>   typedef itk::ImageFileReader< ImageType >  ReaderType;
>   typedef itk::ImageFileWriter< ImageType >  WriterType;
>   typedef itk::AnalyzeImageIO                 ImageIOType;
>
>
>   ReaderType::Pointer reader = ReaderType::New();
>   WriterType::Pointer writer = WriterType::New();
>   ImageIOType::Pointer analyzeIO = ImageIOType::New();
>
>   const char * inputFilename  = argv[1];
>   const char * outputFilename = argv[2];
>
>   reader->SetFileName( inputFilename  );
>   writer->SetFileName( outputFilename );
>
>   writer->SetInput( reader->GetOutput() );
>   writer->SetImageIO( analyzeIO );
>
>   try 
>     { 
>     writer->Update(); 
>     } 
>   catch( itk::ExceptionObject & err ) 
>     { 
>     std::cerr << "ExceptionObject caught !" << std::endl; 
>     std::cerr << err << std::endl; 
>     return EXIT_FAILURE;
>     } 
>
>   return EXIT_SUCCESS;
> }
>
>
>
>
>
>
>       ____________________________________________________________________________________
> Looking for last minute shopping deals?  
> Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
>
>   
>
> ------------------------------------------------------------------------
>
> Betreff:
> [Insight-users] writing space units information in a NRRD file
> Von:
> "Francois Budin" <insight.mailinglist.francois at budin.fr>
> Datum:
> Thu, 7 Feb 2008 14:45:03 -0500
> An:
> insight-users at itk.org
>
> An:
> insight-users at itk.org
>
>
> Hi all,
>
> I am currently working with NRRD image files and when I read them and
> write them back into a file I lose the space units information (ie
> space units: "mm" "mm" "mm")  which was in the input image. I tried to
> find if this piece of information was written somewhere when I load
> the image but it doesn't seem so. I printed the image properties using
> the Print() function and I printed the MetaDataDictionary and it
> appeared in neither of them. I didn't either find any function to read
> or write that in the image properties. I would like to know if it is a
> bug or if ITK removes this on purpose.
> Thanks,
>
> Francois
>
>   
>
> ------------------------------------------------------------------------
>
> Betreff:
> Re: [Insight-users] A bug in itkAnalyzeImageIO?
> Von:
> "Bill Lorensen" <bill.lorensen at gmail.com>
> Datum:
> Thu, 7 Feb 2008 14:50:30 -0500
> An:
> "Jian Wu" <eewujian at yahoo.com>
>
> An:
> "Jian Wu" <eewujian at yahoo.com>
> CC:
> insight-users at itk.org, Hans Johnson <hans-johnson at uiowa.edu>
>
>
> Jian,
> Can you please try the same program with itkNiftiImageIO instead of 
> itkAnalyzeImageIO? The nifti reader/writer should produce valid 
> analyze files. We are looking at replacing itkAnalyzeImageIO's 
> implementation with itkNiftiImageIO. Nifti is a file format with a 
> substantial and active community. If we do this, we will keep the 
> Analyze API.
>
> Thanks,
>
> Bill
>
> On Thu, Feb 7, 2008 at 2:25 PM, Jian Wu <eewujian at yahoo.com 
> <mailto:eewujian at yahoo.com>> wrote:
>
>     Hi,
>     I'm doing image format conversion from other image types to
>     Analyze 7.5. The program did not give me any error message.
>     However I doubt it may not handle the image header information
>     properly. The images I generated in Analyze 7.5 format can be
>     viewed using MRIcro image viewer. But when I tried to opened it
>     using Matlab function analyze75read, it gave me an error message
>     "Reference to non-existent field 'ImgDataType'." I studies the ITK
>     source code and found out the line 1128 of itkAnalyzeImageIO.cxx
>     states:
>     switch( this->m_Hdr.dime.datatype)
>     Here "this->m_Hdr" has not been filled with proper image
>     information yet when the input image is not in Analyze image
>     format. I think "this->m_ComponentType" should be referred
>     instead. My test code is attached here. I used
>     "brainweb1e1a10f20.mha" as the input image.
>
>     Jian
>
>     Command line:
>     ImageReadWriteAnalyze brainweb1e1a10f20.mha brainweb1e1a10f20.img
>
>     Source Code:
>
>     /*=========================================================================
>
>     Program: Insight Segmentation & Registration Toolkit
>     Module: $ ImageReadWriteAnalyze.cxx $
>     Language: C++
>     Date: $Date: 2008/02/07 $
>     Version: $Revision: 1.0 $
>     Author: Jian Wu
>
>     =========================================================================*/
>     #if defined(_MSC_VER)
>     #pragma warning ( disable : 4786 )
>     #endif
>
>     #ifdef __BORLANDC__
>     #define ITK_LEAN_AND_MEAN
>     #endif
>
>     #include "itkImageFileReader.h"
>     #include "itkImageFileWriter.h"
>     #include "itkAnalyzeImageIO.h"
>
>     #include "itkImage.h"
>
>
>     int main( int argc, char ** argv )
>     {
>     if( argc < 3 )
>     {
>     std::cerr << "Usage: " << std::endl;
>     std::cerr << argv[0] << " inputImageFile outputImageFile " <<
>     std::endl;
>     return EXIT_FAILURE;
>     }
>
>     typedef unsigned short PixelType;
>     const unsigned int Dimension = 3;
>     typedef itk::Image< PixelType, Dimension > ImageType;
>
>     typedef itk::ImageFileReader< ImageType > ReaderType;
>     typedef itk::ImageFileWriter< ImageType > WriterType;
>     typedef itk::AnalyzeImageIO ImageIOType;
>
>
>     ReaderType::Pointer reader = ReaderType::New();
>     WriterType::Pointer writer = WriterType::New();
>     ImageIOType::Pointer analyzeIO = ImageIOType::New();
>
>     const char * inputFilename = argv[1];
>     const char * outputFilename = argv[2];
>
>     reader->SetFileName( inputFilename );
>     writer->SetFileName( outputFilename );
>
>     writer->SetInput( reader->GetOutput() );
>     writer->SetImageIO( analyzeIO );
>
>     try
>     {
>     writer->Update();
>     }
>     catch( itk::ExceptionObject & err )
>     {
>     std::cerr << "ExceptionObject caught !" << std::endl;
>     std::cerr << err << std::endl;
>     return EXIT_FAILURE;
>     }
>
>     return EXIT_SUCCESS;
>     }
>
>
>
>
>
>
>     ____________________________________________________________________________________
>     Looking for last minute shopping deals?
>     Find them fast with Yahoo! Search.
>     http://tools.search.yahoo.com/newsearch/category.php?category=shopping
>     _______________________________________________
>     Insight-users mailing list
>     Insight-users at itk.org <mailto:Insight-users at itk.org>
>     http://www.itk.org/mailman/listinfo/insight-users
>
>
>
> ------------------------------------------------------------------------
>
> Betreff:
> Re: [Insight-users] Compiling itk 3.4 with Borland C++ v5.5
> Von:
> Walter Cabrera <walter at eresmas.net>
> Datum:
> Thu, 7 Feb 2008 13:49:55 -0800 (PST)
> An:
> insight-users at itk.org
>
> An:
> insight-users at itk.org
>
>
> Hi Luis,
>
> I am working under Windows. 
> I have done everything according to your guidance, when I run cmake gives an
> error in make.exe. What Make.exe can I use? Where to find it? I can not used
> Make.exe from Borland. 
>
> The main features of cmake are:
>
> CMAKE_CXX_COMPILER    C:/MinGW/bin/g++.exe
> CMAKE_C_COMPILER    C:/MinGW/bin/gcc.exe
> MAKE_COMMAND  make –i
>
> Thanks
>
> Walter
>
>   
>
> ------------------------------------------------------------------------
>
> Betreff:
> [Insight-users] Re: Compiling itk 3.4 with Borland C++ v5.5
> Von:
> Luis Ibanez <luis.ibanez at kitware.com>
> Datum:
> Thu, 07 Feb 2008 17:11:44 -0500
> An:
> walter at eresmas.net, Insight Users <insight-users at itk.org>
>
> An:
> walter at eresmas.net, Insight Users <insight-users at itk.org>
> CC:
>
>
>
> Hi Walter,
>
> The "make" tool should come with the standard development
> package in MinGW.
>
> If you can't find it, that lead us to suspect that your
> MinGW installation is not complete.
>
> I would expect to find "make" in the same directory where
> you have gcc.exe, that is:
>
> C:/MinGW/bin/make.exe
>
> Can you double check that,
> and let us know what you find ?
>
>
> Thanks
>
>
> Luis
>
>
> ---------------------------
> walter at eresmas.net wrote:
>> Hi Luis,
>>
>> I am working under Windows. I have done everything according to your 
>> guidance, when I run cmake gives an error in make.exe. What Make.exe 
>> can I use? Where to find it? I can not used Make.exe from Borland.
>> The main features of cmake are:
>>
>> CMAKE_CXX_COMPILER C:/MinGW/bin/g++.exe
>> CMAKE_C_COMPILER C:/MinGW/bin/gcc.exe
>> MAKE_COMMAND make –i
>>
>> Thanks
>>
>> Walter
>>
>>
>>
>
>
> ------------------------------------------------------------------------
>
> Betreff:
> Re: [Insight-users] A bug in itkAnalyzeImageIO?
> Von:
> Jian Wu <eewujian at yahoo.com>
> Datum:
> Thu, 7 Feb 2008 14:43:24 -0800 (PST)
> An:
> Bill Lorensen <bill.lorensen at gmail.com>
>
> An:
> Bill Lorensen <bill.lorensen at gmail.com>
> CC:
> insight-users at itk.org, Hans Johnson <hans-johnson at uiowa.edu>
>
>
> Hi, Bill,
>
> Thanks for the prompt reply. Actually, I have tried to use 
> itkNiftiImageIO. Without explicitly specifying an ImageIO class, the 
> ITK would use itkNiftiImageIO by default if the images have the 
> extension of 'hdr' or 'img'. I tried and failed in the first place. 
> That's why I tried to explicitly use itkAnalyzeImageIO later. When 
> itkNiftiImageIO was used, the Matlab reader gave me exactly the same 
> error message. Even worse, the converted analyze image could not be 
> opened by MIRcro. A simple test code is attached here, very similar to 
> the previous one.
>
> Jian
>
> Command line:
> ImageReadWrite brainweb1e1a10f20.mha brainweb1e1a10f20.img
>
> Source Code:
> /*=========================================================================
>
> Program: Insight Segmentation & Registration Toolkit
> Module: ImageReadWrite.cxx,v $
>
> =========================================================================*/
> #if defined(_MSC_VER)
> #pragma warning ( disable : 4786 )
> #endif
>
> #ifdef __BORLANDC__
> #define ITK_LEAN_AND_MEAN
> #endif
>
> #include "itkImageFileReader.h"
> #include "itkImageFileWriter.h"
> #include "itkImage.h"
>
> int main( int argc, char ** argv )
> {
> if( argc < 3 )
> {
> std::cerr << "Usage: " << std::endl;
> std::cerr << argv[0] << " inputImageFile outputImageFile " << std::endl;
> return EXIT_FAILURE;
> }
>
> typedef unsigned short PixelType;
> const unsigned int Dimension = 3;
> typedef itk::Image< PixelType, Dimension > ImageType;
>
> typedef itk::ImageFileReader< ImageType > ReaderType;
> typedef itk::ImageFileWriter< ImageType > WriterType;
>
> ReaderType::Pointer reader = ReaderType::New();
> WriterType::Pointer writer = WriterType::New();
>
> const char * inputFilename = argv[1];
> const char * outputFilename = argv[2];
>
> reader->SetFileName( inputFilename );
> writer->SetFileName( outputFilename );
>
> writer->SetInput( reader->GetOutput() );
>
> try
> {
> writer->Update();
> }
> catch( itk::ExceptionObject & err )
> {
> std::cerr << "ExceptionObject caught !" << std::endl;
> std::cerr << err << std::endl;
> return EXIT_FAILURE;
> }
>
> return EXIT_SUCCESS;
> }
>
>
>
> ----- Original Message ----
> From: Bill Lorensen <bill.lorensen at gmail.com>
> To: Jian Wu <eewujian at yahoo.com>
> Cc: insight-users at itk.org; Hans Johnson <hans-johnson at uiowa.edu>; kent 
> williams <nkwmailinglists at gmail.com>
> Sent: Thursday, February 7, 2008 2:50:30 PM
> Subject: Re: [Insight-users] A bug in itkAnalyzeImageIO?
>
> Jian,
> Can you please try the same program with itkNiftiImageIO instead of 
> itkAnalyzeImageIO? The nifti reader/writer should produce valid 
> analyze files. We are looking at replacing itkAnalyzeImageIO's 
> implementation with itkNiftiImageIO. Nifti is a file format with a 
> substantial and active community. If we do this, we will keep the 
> Analyze API.
>
> Thanks,
>
> Bill
>
> On Thu, Feb 7, 2008 at 2:25 PM, Jian Wu <eewujian at yahoo.com 
> <mailto:eewujian at yahoo.com>> wrote:
>
>     Hi,
>     I'm doing image format conversion from other image types to
>     Analyze 7.5. The program did not give me any error message.
>     However I doubt it may not handle the image header information
>     properly. The images I generated in Analyze 7.5 format can be
>     viewed using MRIcro image viewer. But when I tried to opened it
>     using Matlab function analyze75read, it gave me an error message
>     "Reference to non-existent field 'ImgDataType'." I studies the ITK
>     source code and found out the line 1128 of itkAnalyzeImageIO.cxx
>     states:
>     switch( this->m_Hdr.dime.datatype)
>     Here "this->m_Hdr" has not been filled with proper image
>     information yet when the input image is not in Analyze image
>     format. I think "this->m_ComponentType" should be referred
>     instead. My test code is attached here. I used
>     "brainweb1e1a10f20.mha" as the input image.
>
>     Jian
>
>     Command line:
>     ImageReadWriteAnalyze brainweb1e1a10f20.mha brainweb1e1a10f20.img
>
>     Source Code:
>
>     /*=========================================================================
>
>     Program: Insight Segmentation & Registration Toolkit
>     Module: $ ImageReadWriteAnalyze.cxx $
>     Language: C++
>     Date: $Date: 2008/02/07 $
>     Version: $Revision: 1.0 $
>     Author: Jian Wu
>
>     =========================================================================*/
>     #if defined(_MSC_VER)
>     #pragma warning ( disable : 4786 )
>     #endif
>
>     #ifdef __BORLANDC__
>     #define ITK_LEAN_AND_MEAN
>     #endif
>
>     #include "itkImageFileReader.h"
>     #include "itkImageFileWriter.h"
>     #include "itkAnalyzeImageIO.h"
>
>     #include "itkImage.h"
>
>
>     int main( int argc, char ** argv )
>     {
>     if( argc < 3 )
>     {
>     std::cerr << "Usage: " << std::endl;
>     std::cerr << argv[0] << " inputImageFile outputImageFile " <<
>     std::endl;
>     return EXIT_FAILURE;
>     }
>
>     typedef unsigned short PixelType;
>     const unsigned int Dimension = 3;
>     typedef itk::Image< PixelType, Dimension > ImageType;
>
>     typedef itk::ImageFileReader< ImageType > ReaderType;
>     typedef itk::ImageFileWriter< ImageType > WriterType;
>     typedef itk::AnalyzeImageIO ImageIOType;
>
>
>     ReaderType::Pointer reader = ReaderType::New();
>     WriterType::Pointer writer = WriterType::New();
>     ImageIOType::Pointer analyzeIO = ImageIOType::New();
>
>     const char * inputFilename = argv[1];
>     const char * outputFilename = argv[2];
>
>     reader->SetFileName( inputFilename );
>     writer->SetFileName( outputFilename );
>
>     writer->SetInput( reader->GetOutput() );
>     writer->SetImageIO( analyzeIO );
>
>     try
>     {
>     writer->Update();
>     }
>     catch( itk::ExceptionObject & err )
>     {
>     std::cerr << "ExceptionObject caught !" << std::endl;
>     std::cerr << err << std::endl;
>     return EXIT_FAILURE;
>     }
>
>     return EXIT_SUCCESS;
>     }
>
>
>
>
>
>
>     ____________________________________________________________________________________
>     Looking for last minute shopping deals?
>     Find them fast with Yahoo! Search.
>     http://tools.search.yahoo.com/newsearch/category.php?category=shopping
>     _______________________________________________
>     Insight-users mailing list
>     Insight-users at itk.org <mailto:Insight-users at itk.org>
>     http://www.itk.org/mailman/listinfo/insight-users
>
>
>
>
> ------------------------------------------------------------------------
> Never miss a thing. Make Yahoo your homepage. 
> <http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>   
Hi Alfredo,

patient 6 and 7 are on the server. I took some time, cause I had to 
correct more this time.

LG,

Karl


-- 
----------------------------------------------------------------------------------------------------
DDr. Karl D. Fritscher
Institute for Biomedical Image Analysis (IBIA)
University for Health Sciences, Medical Informatics and Technology (UMIT)

Eduard-Wallnöfer-Zentrum 1
A-6060 Hall in Tirol, Austria

e-mail: karl.fritscher at umit.at
http://imwv.umit.at/

Tel.: +43 (0)50 8648 - 3866
Cell phone: +43 (0) 676 - 3306221 



More information about the Insight-users mailing list