ivmartel / dwv-jqmobile

Medical image viewer using DWV (DICOM Web Viewer) and jQuery Mobile.
https://ivmartel.github.io/dwv-jqmobile/
GNU General Public License v3.0
32 stars 26 forks source link

how to change orientation of images #178

Closed noorfatma closed 10 months ago

noorfatma commented 10 months ago

Hi,

I am trying to load the images in sagittal view. For that I am changing the orientation of the viewconfig. But i see only a thin line of images. what am I missing.

const viewConfig0 = new dwv.ViewConfig('layerGroup0');
viewConfig0.orientation = "sagittal";
const viewConfigs = {'*': [viewConfig0]};

// main application
var myapp = new dwv.App();
myapp.init(options);
myapp.setDataViewConfigs(viewConfigs);
ivmartel commented 10 months ago

If you only load one slice that is axial and try to see it in coronal or sagittal, it is normal that you only see a line. You have to load more than one slice.

noorfatma commented 10 months ago

Even when I am loading the folder, the same thing happens. I see a one or two pixel horizontal line. When I scroll, i can see the slices changing in those pixels. I am attaching the screen recording.

https://github.com/ivmartel/dwv-jqmobile/assets/51729029/2c71c743-9ae7-41e5-a4b4-de1215289795

ivmartel commented 10 months ago

The library has a default mode to do its first image display when it receives the first image. So at this point, you only have one slice. Reorienting the data results in the line you have. To create an oriented view after launching a load, you have to wait for all the data to be loaded. Set the app option viewOnFirstLoadItem to false and call app.render(dataId) when you receive a load event.

noorfatma commented 10 months ago

Thanks a ton, its working now.