I am customizing PV Glance to add to our app, something that we struggle with is to load multiple datasets with different color maps pre-set at load.
We were able to add custom features inside the code that we can change the colormap during load, but how can we pass multiple files with different settings to the app?
The way to go is to load a single *.glance file that can refer to other remote dataset while enabling to configure any rendering settings, color, representations and views…
Thank you so much for the response. I’ve spent last a few days trying to figure out the structure of the glance file but I couldnt find any reference. Can you please share a resource to help me build the glance file inside my python code? Because we need to build that inside our code.
Thanks
The way to go is to load 1 remote dataset, tune the UI the way you want and save the state (*.glance) file.
At that point, you unzip that glance file and look at the JSON structure of the file. That file should be fairly simple to follow. And from your learning, you should be able to add as many remote dataset as you want with all the required tuning you may be looking for. You can always start with the glance files available here.
Thank you so much, this is exactly what I was looking for. Using this template I can easily change the UI setting, now the question would be can I give nii.gz url inside this JSON or should I put the vtk array in it directly? If I can just put url in it, can you please provide an example. All examples you have are using Girder to load file, I am trying to load file from source directly.
It should be simpler than that. Load an external file using url and save a glance file. At that point the data does-not come from Girder and you will see how the url get used.
That’s my problem, when I am using url and save the state file, the entire file is paste there as vtk array. Basically the glance file, becomes a vtk array + UI settings.
Are you still trying the state.json file you’ve attached in your previous post? Or are you re-generating your glance file via the save state button? if you’re using your aforementioned state.json file, you need to modify your sources object like so:
No I regenerated from a new installation. Basically I re-built the code on my computer and trying to export, gives me the same file as before. I made sure that I have the latest version as well.
I load it, save state, then I can load the resulting glance file and the dataset shows up. Can you provide more details as to what is the error you get now, if it’s different from before?