[Insight-users] Cannot debug projects of ITKApplication.

jimmy jimmy_lab at 163.com
Mon Jul 23 11:03:20 EDT 2007


Hi, Luis:

	Thank you for your suggestion.
	I am sorry that I have not describe my problem clearly.
	I have already generate the MetaImage head (.mhd) beforehand.  
	And I used ImageFileReader correctly and access the data successfully by my own codes.( It also could be debugged )
	
	However what confused me is that I cannot DEBUG in *ITKApplication* as I mentioned before, but the RLEASE mode is okay.
	Could you give me any other suggestion?

Thank you very much indeed.

Sincerely,
Jimmy

------------------				 
jimmy
2007-07-23

-------------------------------------------------------------
发件人:Luis Ibanez
发送日期:2007-07-23 21:35:51
收件人:jimmy
抄送:insight-users
主题:Re: [Insight-users] Cannot debug projects of ITKApplication.


Hi Jimmy,

You should have mentioned from the beginning that you
were attempting to read a RAW image file.


        You *CANNOT* read a RAW image file
        directly with the ImageFileReader.



You have the following options:

  a) Create a MetaImage header for the RAW file.
  b) Use explicitly the RAWImageIO class in your code.


From these two options, method (a) is the recommended one
because method (b) results in hard-coding the image
parameters in your program.


The easiest way of creating a MetaImage header for your
raw image is to use the program:


   InsightApplications/MetaImageImporter


It is a command-line dialog that will guide you through
the process by asking you questions about your image.


The filename extension of your MetaImage header must be
".mhd".

Once you have created this header, you can pass it as
the filename to be read by the ImageFileReader.


   Regards,


      Luis


============================
jimmy wrote:
> Here is an example of this problem:
> 
> I use itk::ImageFileReader [reader] to read a Raw data.  After the file name is set, and it runs to 
> [reader]->Update();    Error occurs.
> 
> The following is call stack of Debugger:
> 
> 	itk::ImageIOFactory::CreateImageIO(const char * path=0x0139d870, itk::ImageIOFactory::FileModeType mode=ReadMode)  Line75 + 0x57	 
> 	if((*k)->CanReadFile(path))
>     {
>         return *k;
>     }
> 
>  	itk::ImageFileReader<itk::Image<unsigned short,2>,itk::DefaultConvertPixelTraits<unsigned short> >::GenerateOutputInformation()  Line109 + 0x27
>  	ITKCommon.dll!itk::ProcessObject::UpdateOutputInformation()  Line760	
>  	itk::ImageBase<2>::UpdateOutputInformation()  Line177 + 0x3e	
>  	ITKCommon.dll!itk::DataObject::Update()  Line343	
> 
> 
> Thanks in advance.
> ------------------				 
> jimmy
> 2007-07-23
> 
> -------------------------------------------------------------
> 发件人:Luis Ibanez
> 发送日期:2007-07-22 22:57:00
> 收件人:jimmy
> 抄送:insight-users
> 主题:Re: [Insight-users] Cannot debug projects of ITKApplication.
> 
> Hi Jimmy,
> 
> Can you look at the call stack in the debugger ?
> 
> Could you trace what is the ITK file, and line
> that is triggering the error ?
> 
> Please let us know,
> 
> 
>   Thanks
> 
> 
>     Luis
> 
> 
> ----------------
> jimmy wrote:
> 
>>Hi, everyone.
>>
>>I have met a very strange problem when using ITKApplication:
>>I cannot debug or run Applications (e.g. ImageRegistration2D ,IntensityBased2D3DRegistration ) under the DEBUG mode in VS 2003. 
>>Here is the Error message:
>>"
>>Debug Assertion Failed!
>>Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
>>"
>>at [m_FixedImageReader or other object]->Update();
>>
>>On the contrary, the project can be run very smoothly under RELEASE mode.
>>
>>Can anyone help me?  Thanks in advance.
>> 				
>>--------------
>>jimmy
>>2007-07-21
>>
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk.org
>>http://www.itk.org/mailman/listinfo/insight-users
>>
> 
> 


More information about the Insight-users mailing list