nci / drishti

Drishti
MIT License
176 stars 40 forks source link

Incorrect slicing in drishtiimport #54

Closed RendersJens closed 3 years ago

RendersJens commented 3 years ago

The following Python snippet generates a volume and stores it as a (float32) tiff stack:

import tomopy
import dxchange

data = tomopy.shepp3d(128)
data = data[:,:120, :] #make sure the slices will be non-square, otherwise the bug does not show
dxchange.write_tiff_stack(data, "shepp/slice")

When loading this tiff stack into drishtiimport, the slicing in the X and Y direction goes wrong seemingly because the the width and height of the tiffs are swapped (the slices show a varying shift in the Y direction).

image image

AjayLimaye commented 3 years ago

H RendersJen, Can you send me the tiff image stack to figure out the solution. Cheers, Ajay

On Tue, Mar 2, 2021 at 9:32 PM RendersJens notifications@github.com wrote:

The following snippet generates a volume and stores it as a (float32) tiff stack:

import tomopy import dxchange

data = tomopy.shepp3d(128) data = data[:,:120, :] #make sure the slices will be non-square, otherwise the bug does not show dxchange.write_tiff_stack(data, "shepp/slice")

When loading this tiff stack into drishtiimport, the slicing in the X and Y direction goes wrong seemingly because the the width and height of the tiffs are swapped (the slices show a varying shift in the Y direction).

[image: image] https://user-images.githubusercontent.com/43435876/109635533-c81be600-7b4a-11eb-88f0-5dcf14903716.png [image: image] https://user-images.githubusercontent.com/43435876/109635571-d4a03e80-7b4a-11eb-98de-9b6dbd93cad2.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nci/drishti/issues/54, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMVVLTF73WM5JQAXVRBLTLTBS5CFANCNFSM4YOVLLJA .

--

Ajay Limaye

VIsualization Programmer, NCI Australia http://www.nci.org.au/

The Australian National University

143 Ward Road

Acton, ACT, 2601

T: +61 2 6125 4616

Want the latest news http://nci.org.au/research-news/news/ from NCI?

Find out more about NCI: YouTube http://www.youtube.com/user/NCINationalFacility / Facebook https://www.facebook.com/NCIAustralia/ / Twitter https://twitter.com/NCInews / LinkedIn https://www.linkedin.com/company/national-computational-infrastructure/

[image: cid:image002.png@01D449EE.B750D8C0]

RendersJens commented 3 years ago

Sure, here it is: shepp.zip This is just and example though, it happens everytime when the tiffs are not square. You can generate more examples by editing the Python snippet above.

Thank you for looking in to it! Jens

AjayLimaye commented 3 years ago

Hi Jens, I am unable to reproduce the bug. What version of Drishti do you have? Cheers, Ajay [image: image.png]

On Wed, Mar 3, 2021 at 9:26 AM RendersJens notifications@github.com wrote:

Sure, here it is: shepp.zip https://github.com/nci/drishti/files/6072182/shepp.zip This is just and example though, it happens everytime when the tiffs are not square. You can generate more exampels by editing the Python snippet above.

Thank you for looking in to it! Jens

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nci/drishti/issues/54#issuecomment-789265129, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMVVLQOMF7LHLM7K7T2LGLTBVQZXANCNFSM4YOVLLJA .

RendersJens commented 3 years ago

I was using v2.6.3 (linux) and v2.6.5 (windows), but I also tested it in the latest release v2.7 (linux) and in all cases the bug is there. I see that you attached an image to your comment but it is not uploaded correctly. so I cannot see it.

Jens

AjayLimaye commented 3 years ago

[image: image.png]

On Wed, Mar 3, 2021 at 11:52 PM RendersJens notifications@github.com wrote:

I was using v2.6.3, but I also tested it in the latest release v2.7 (linux) and in both cases the bug is there. I see that you attached an image to your comment but it is not uploaded correctly. so I cannot see it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nci/drishti/issues/54#issuecomment-789692729, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMVVLUJJ2OAUHOT72T4ZP3TBYWHDANCNFSM4YOVLLJA .

AjayLimaye commented 3 years ago

This one was tested on Windows PC, do you have access to a Windows machine ?

On Thu, Mar 4, 2021 at 9:04 AM Ajay Limaye limaye.ajay@gmail.com wrote:

[image: image.png]

On Wed, Mar 3, 2021 at 11:52 PM RendersJens notifications@github.com wrote:

I was using v2.6.3, but I also tested it in the latest release v2.7 (linux) and in both cases the bug is there. I see that you attached an image to your comment but it is not uploaded correctly. so I cannot see it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nci/drishti/issues/54#issuecomment-789692729, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMVVLUJJ2OAUHOT72T4ZP3TBYWHDANCNFSM4YOVLLJA .

RendersJens commented 3 years ago

I do, as I said in the previous comment, I saw the bug on v2.6.5 on windows as well. Perhaps that didn't come trough because I edited it later. The image still doesn't come trough, can you check the thread on the github website instead of commenting via email? I think that is the cause of the issue.

Thanks again! Jens

AjayLimaye commented 3 years ago

image

RendersJens commented 3 years ago

Alright, I see the image now, thank you. This is the same as what I see, the slices look correct when viewing the Z axis in drishtiimport. But once you select the X or Y axis (then the slices are different from the stored tiffs) the bug appears. This is what I show on my screenshots.

Jens

AjayLimaye commented 3 years ago

Ok, got it - yes need to fix slice display in the importer.

AjayLimaye commented 3 years ago

Fixed it - will be available with the next release. Thanks for detecting the bug image image

RendersJens commented 3 years ago

Great, thanks for the fix!