FNNDSC / ami

AMI Medical Imaging (AMI) JS ToolKit
https://fnndsc.github.io/ami/#viewers_upload
MIT License
719 stars 213 forks source link

[feature] Sagittal and coronal views are zoomed out #97

Open JoyBoy-369 opened 7 years ago

JoyBoy-369 commented 7 years ago

Hi @NicolasRannou , I came across a study and when i tried it on the viewers upload example, I got the images below. This is the first study that where the sagittal and coronal views have zoomed out. The axial view remains unchanged though.

snip20170203_1 snip20170203_3 snip20170203_4

NicolasRannou commented 7 years ago

Interesting... Can you share the dataset with us?

NicolasRannou commented 7 years ago

also something looks wrong with the CSS, see the top left/right orientation letter should be in the middle of the screen.

JoyBoy-369 commented 7 years ago

Ah yes. The CSS seems to be messed up only on safari. It works fine in chrome. I'll look into it and see what's the issue. The study can be found in the link. https://drive.google.com/open?id=0BzZ8vGDWQZfmLVppdFp4RmFkTms

NicolasRannou commented 7 years ago

FYI - the issue is that the orthographic camera fit function doesn't not work properly when the volume is not roughly oriented along X/Y/Z axes.

Note for later: It causes the World Bounding Box to be way to big hence the fit function zooms out. We should pass the IJK volume and the WorldToData transforms to the camera somehow to properly compute the volume dimensions given the direction we are interested in.

https://github.com/FNNDSC/ami/blob/dev/src/cameras/cameras.orthographic.js#L502-L524

JoyBoy-369 commented 7 years ago

Ahh! I see. Thank you very much.