Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing .mha shifts image #9

Open
ctrueden opened this issue Jul 2, 2016 · 4 comments
Open

Importing .mha shifts image #9

ctrueden opened this issue Jul 2, 2016 · 4 comments

Comments

@ctrueden
Copy link
Member

ctrueden commented Jul 2, 2016

A report from acramp on the ImageJ forum:

I ran into a problem where the image gets shifted when reading it from a .mha file. A part from the image which should be at the right border is shown on the left border. This issue is only with uncompressed .mha. Compressed .mha or .mhd are read correctly.

How to reproduce:

  1. Create Image (File->New->Image...) 400x400, White Background, 1 slice is sufficient.
  2. Draw a cross through the whole image (Place line, then Edit->Draw)
  3. Save image as .mha (File->Save As->MHD/MHA...)
  4. Import image (File->Import->MHD/MHA...)
  5. Observe shifted image (as if it uses the header as image information).

The problem is not with the file, which e.g. in ITK-SNAP opens correctly.

@ctrueden
Copy link
Member Author

ctrueden commented Jul 2, 2016

The bug is likely in the MetaImage_Reader class.

@rcatwood
Copy link

rcatwood commented Jun 1, 2017

+11 months ...
Updated FIJI this morning , this ticket bug is still there.

result.zip

run("Close All");
newImage("Untitled", "8-bit ramp", 512, 512, 1);
makeRectangle(129, 165, 181, 165);
setForegroundColor(255, 0, 0);
run("Draw", "slice");
saveAs("PNG", "./rectpng.png");
run("MHD/MHA ...", "save=./rectmha.mha");
run("Close All");
open("./rectpng.png");
open("./rectmha.mha");
imageCalculator("Subtract create 32-bit", "rectpng.png","rectmha.mha");
selectWindow("Result of rectpng.png");
saveAs("Tiff", "./result.tif");

@rcatwood
Copy link

rcatwood commented Jun 1, 2017

Interestingly, it happens in Windows version but not in the Linux version ... (both updated this morning)

@ctrueden
Copy link
Member Author

ctrueden commented Jun 1, 2017

+11 months ...

Very soon now, each component's associated wiki page will be auto-updated to reflect reality regarding who is maintaining it, and at what levels.

This component currently lists @jefferis as debugger and reviewer, but I do not know if he is actually investigating bugs like this in practice these days. We may need to adjust the information to reflect the fact that this component is largely unmaintained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants