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

r.niklaus at gmx.ch r.niklaus at gmx.ch
Mon Jul 16 11:46:47 EDT 2012


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!



More information about the Insight-users mailing list