Page MenuHomePhabricator

Loading of hdwi and nhdr behaves strangely
Closed, ResolvedPublic

Description

When opening MITK and loading .nhdr or .hdwi images via the "Open" Button an error message is displayed and the image not loaded:

291.56 core.mod.difImg.nrrddiffusionimagereader: itk::ERROR: NrrdImageIO(0000000
00B277630): ReadImageInformation: Error reading \DTI-ATLAS\DTI\DTI.hdwi:
[nrrd] nrrdLoad: trouble reading "\DTI-ATLAS\DTI\DTI.hdwi"
[nrrd] nrrdRead: trouble
[nrrd] _nrrdRead: trouble reading NRRD file
[nrrd] _nrrdFormatNRRD_read: couldn't open the first datafile
[nrrd] nrrdIoStateDataFileIterNext: couldn't open "./raw.raw" (data file 1 of 1) for reading
300.61 core.io.imgFileReader: loading \DTI-ATLAS\DTI\DTI.nhdr via itk::ImageIOFactory...
327.17 core.mod.difImg.nrrddiffusionimagereader: itk::ERROR: NrrdImageIO(0000000
00B277B10): ReadImageInformation: Error reading \DTI-ATLAS\DTI\DTIMasked.hdwi:
[nrrd] nrrdLoad: trouble reading "\DTI-ATLAS\DTI\DTIMasked.hdwi"
[nrrd] nrrdRead: trouble
[nrrd] _nrrdRead: trouble reading NRRD file
[nrrd] _nrrdFormatNRRD_read: couldn't open the first datafile
[nrrd] nrrdIoStateDataFileIterNext: couldn't open "././DTIMasked.raw" (data file 1 of 1) for reading

If they are, on the other hand, dragged and dropped in MITK loading works without problem.

Should test with other files on my computer and my files on other computers.

I had the problem on Windows Vista SP3 X64
Igys Mac worked fine (different images)

So might be a platform specific problem, but not sure.

Related Objects

StatusAssignedTask
ResolvedNone
ResolvedNone

Event Timeline

Strange indeed.. raw and header files in the same folder? Does the link to the raw file in the header contain any slashes? Or is it just the pure file name?

One contains

datafile: raw.raw

data file: ./DTIMasked.raw

Is the position of the tag in the header standardized? The first was kind of middlish, the other was the last entry in the header.

Header and raw are in the same folder.

Errr, missing a "the other" between the two tags, didN't have different datafiles specified in the same header of course.

See my files in home/goch/Transfer/bug_9690

Unable to reproduce on Ubuntu 11.04, all test images from Caspar's were loaded successfully.

On windows it tries to read the wrong path. Most likely it tries reading relative to the application path isntead of relative to the header path. The writer should build itself a correct absolute path (maybe take a look at how drag&drop does it)

After saving Pic3D.pic.gz as a .nhdr file, the file was loaded per Drag'n'Drop for both

Pic3D.raw 
./Pic3D.raw

set as 'data file'.

Seems to only be occuring on Windows 64 Bit. So far Linux, Mac and Windows 32 Bit could not reproduce.

Possibly fixed by the bugfix for T9758.

Caspar, can you please test the fix?

[3ef5cf]: Merge branch 'bug-9690-LoadingNrrdHeaderFiles'

Merged commits:

2011-10-14 17:21:01 Jan Hering [bb8ede]
Added file path conversion to ExtFileOpenAction

  • otherwise the ITK Nrrd reader fails on Win 64bit

The newest fix tested manually on Win64 system. Issue solved. Closing bug.