Integrate Paraview Glance with Django, loading datas from the backend

I’m developing a Django web application that process neuroimaging datas such as MRI. The backend register an atlas and produces meshes (.vtk or .vtp) and masks (with the help of Slicer in CLI) when an user send a volume nii.gz file.

I’ve integrated ParaviewGlance to my web app, but I don’t know how to load datas with a script (It works with the urls). Also, I would like to change color of my vtp files (atlas meshes), the default view configuration (set to quadview) , set some parameters of the 3D view etc …

I’m pretty new with JS modern front end. Could you help me to connect with the paraview glance API ?

Thanks a lot

ps : I use 3D Slicer a lot.

A way to control that is to create a *.glance file that will describe the data that would need to be fetch (remote url) along with view/color setting which could be provided as an endpoint from django. You may want to create the first file using the UI and then asking the app to save the .glance file. Then if you unzip it you will notice the JSON structure that could then be dynamically generated on your end.

That’s really nice. It worked Thank you ! My web app will be online on January, I would let you know.

I have another question about paraview Glance. My *.vtp meshes on PGlance are in 3D, but I would like to show the intersection between the NIfTI Volumes and the meshes on the every slices (like in 3D Slicer). Do you know how to that ?

Below, 2 screenshots :

  • PGlance visualization
  • 3D slicer kind of view I would like to have.

Thanks a lot

Hi, Glance does not yet show mesh slices yet, but this is supported in vtk.js via the vtkCutter class. I’m interested in adding sliced geometry views to Glance, so this will come in time.