Sharing custom presets

This is something I wanted for the SlicerMorph project for a while and I bite the bullet and asked copilot to create a github repo to share and add presets.

As indicated in the contributing.MD you simply add two items to the preset folder volume property json file and a png (file prefixes need to be identical). After the PR is merged, an automated action updates the README file with the new entries for easy visual browsing. You can click on the download to get the URL of the vp.json file which you can use the Sample Data module to import directly into the scene.

I am sure we can build something much easier to add and grow but I wanted to have the conversation started.

I like this, thanks for putting it together.

To make it easier to grow the collection, we could create some code that automates the contribution process. Basically if you have a rendering you like, you could just do a one-click submission by using gh under the hood to do the whole PR process.

Yes, definitely if you have gh installed and authenticated it is a one liner. So that might be an option for people who are already using MorphoDepot since it is already there, but I am not sure if gh CLI use is general enough to build a tool around it just for this.

I do make the screenshots in the hiresScreenCapture because it is much easier to control the aspect ratio and get 1:1 (or close).

Spent a bit more time to make it a bit more automated. So now you create your volume property in Slicer and upload it directly from a module.

If you want to try out, you can try the vp-submit branch in the SlicerMorph git clone --branch vp-submit https://github.com/SlicerMorph/SlicerMorph.git

After that you can:

  1. Load a volume and enable volume rendering and create one VolumeProperty preset in the scene (or edit one of the existing preset to make it different).

  2. While strictly not necessary, I suggest renaming it different from the original preset name.

Submitting a preset

  1. Open the SubmitVolumeRenderingPreset module (under SlicerMorph Utilities).

  2. Select your vp from the dropdown. You can hit refresh to get all the volume property loaded in the scene Fill in an optional description and author name.

  3. Choose a 3-D view and arrange it as you want it to appear in the gallery.

  4. Click – Upload and submit to GitHub. The module uploads both vp.json and the captures screenshot automatically (saved to a temp location) and opens a pre-filled GitHub issue in your browser.

  5. Click Submit new issue

This would create a PR for me to take a quick look and once merged it will be shown at GitHub - SlicerMorph/VPs: trial repo for sharing volume rendering properties · GitHub

Note that I decided to use the new JSON based volume rendering property file as opposed to old txt file. Make sure you are trying with a preview version.

Suggestions are welcomed.

I have turned this into a module called VRPresetHub in SlicerMorph, it will be available for the preview builds tomorrow.

It has two tabs, first one allows you to contribute your volume rendering preset to the public GitHub - SlicerMorph/VPs: trial repo for sharing volume rendering properties · GitHub repo (creates an issue and automatically opens a PR for me to review and merge).

Second tab, PresetBrowser shows the available merged presets from the repo and lets you either import into the scene or directly apply to the currently active volume. Here is short demo (in video it shows the old module name, ignore that):

Suggestions welcome.

test

Cool!

One thought: is there an easy way to restore the original property after testing?

Not directly right now. It doesn’t overwrite the existing property, it simply replaces it with the new one. So if you know what the original one, you can go back to it at the Volume Rendering module.

Thought it can be made more convenient I suppose.

There is now a “Revert to original” button.