[Insight-users] Read MetaImage and Analyze files with symbolic links

Bradley Lowekamp blowekamp at mail.nih.gov
Tue Jul 17 08:55:41 EDT 2012


Hello,

This sounds like a problem with the ITK ImageIO and not SimpleITK.

You said that this works with ITKSNAP, what version and what version of ITK does it use?

I would like to specifically know the file is laid out. The error message is saying it can't load the following file:

> F:\\Analyze\\c21d6db2eaf740e398a1a50bd1b91a41.hdr


Does that file exist? Is it the symlink or the actual file?

I am unfortunately not familiar with the behavior of symlinks on windows. 

Brad


On Jul 16, 2012, at 11:46 AM, r.niklaus at gmx.ch wrote:

> Hello
> 
> We are using SimpleITK to wrap it for usage in C# environment. Everything works perfect if the header (.hdr for Analyze) 
> and source (.img for Analyze) files are "real" available. To find the corresponding source file it must be named the same like the header file.
> 
> private void ReadFile(string path)
> {
> 	// Read input image
> 	ImageFileReader reader = new ImageFileReader();
> 	reader.SetFileName(path);
> 	this.image = reader.Execute();
> 	reader.Dispose();
> }
> 
> The methods are provided by SimpleITKCSharpManaged.dll
> 
> Problem: Now we want to use symbolic links for source files. The header is "real" available but the source is a symbolic link pointing 
> to the "real" one. In this case it doesn't work (the header cannot open the source file). It fails at reader.Execute(); with the following 
> message:
> 
> {"Exception thrown in SimpleITK ImageFileReader_Execute: C:\\Insight-Toolkit-Temp\\ITK_4.0\\Modules\\IO\\NIFTI\\src\\itkNiftiImageIO.cxx:500:\nitk::ERROR: NiftiImageIO(09D207D0): nifti_image_load failed for file: F:\\Analyze\\c21d6db2eaf740e398a1a50bd1b91a41.hdr"}
> 
> Does anyone encountered a similar problem? 
> 
> Should it be generally possible to use symbolic links instead of "real" files?
> 
> I have tested the procedure with ITK-SNAP and this tool is able to open symbolic links.
> 
> Thanks in advance for any respondence!
> 
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users

========================================================
Bradley Lowekamp  
Medical Science and Computing for
Office of High Performance Computing and Communications
National Library of Medicine 
blowekamp at mail.nih.gov



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120717/d9d8432e/attachment.htm>


More information about the Insight-users mailing list