Hi @lassoan, I followed these conversations. Upto Chat #7, I am successfully opening the mentioned .nrrd file in your example from that link. But when I am sending a downloadable .nrrd file from AWS S3 bucket, the url had some tokens, So it is not loading the file in Slicer 3D. And I am facing same error as discussed by @OLIVERFCHEN in Chat #14, its in 0%, and given that positional argument related error. I followed the next chats. And your fix in Chat #15 is already there in that Dicom util file. Please help.
Could you please provide an example URL that you would expect to work but it doesnāt?
It was all good, you just forgot to URL-encode the URL, so the script interpreted the URL parameters as additional query parameters for Slicer.
Iāve made some improvements to the LoadRemoteFile module (it can now open multiple volumes and segmentations and show them in 3D) and moved it to the Sandbox extension, so that users can easily install it by a few clicks.
How to use:
- Install latest version of Sandbox extension (on 2023-02-14 or later)
- Construct an URL as explained here and open the URL in a web browser. For example, copy these URLs to the web browserās address bar to open them in Slicer:
- LungCTAnalyzerChestCT image:
slicer://viewer/?download=https%3A%2F%2Fgithub.com%2Frbumm%2FSlicerLungCTAnalyzer%2Freleases%2Fdownload%2FSampleData%2FLungCTAnalyzerChestCT.nrrd
- LungCTAnalyzerChestCT image + segmentation:
slicer://viewer/?show3d=true&segmentation=https%3A%2F%2Fgithub.com%2Frbumm%2FSlicerLungCTAnalyzer%2Freleases%2Fdownload%2FSampleData%2FLungCTAnalyzerMaskSegmentation.seg.nrrd&image=https%3A%2F%2Fgithub.com%2Frbumm%2FSlicerLungCTAnalyzer%2Freleases%2Fdownload%2FSampleData%2FLungCTAnalyzerChestCT.nrrd
- LungCTAnalyzerChestCT image:
@lassoan, Installed Sandbox extension but it had installed (2022-12-31) version. It is not even loading the example nrrd file.
I followed the updated LoadRemoteFile.py and placed it in qt-scripted-modules folder.
Now file is not downloading my encoded file (but downloading the provided .nrrd file in example). It is just giving 0% in pop-up and in log also 3 times. Then after giving error while trying to remove the file (os.remove()) as the file is not downloaded.
Please help Sir.
Sorry Sorry. Thanks Sir. Itās working. With that segmentation key.
Hi @lassoan, Sandbox extension is now installing still version 2022-12-31. Can you please tell me how to install the latest(2023-02-14 or later) ?
Oh. Okay. Its installed by default version 2022-12-31. But when checked for update, Its giving version 2023-02-14 available.
See how to update an extension here.
Update from Extensions Manager is available for latest Slicer Stable Release.
If you use a Slicer Preview Release then you donāt get extension updates but you need to install a more recent Slicer Preview Release.
Hi @lassoan , There is a bug in LoadRemoteFile.py . The encoded URI is not properly decoding here in the code. Each time the log in slicer is showing ā//////ā inside the URI instead of ā%F%F%Fā after decoding. So my file is not uploading in the slicer.
I had crosschecked the file by encoding an decoding the encoded file.
It is giving the actual downloadable file.
Please provide a complete example that reproduces the issue.
Thanks, the url was decoded twice. Fixed now.
Hi @lassoan I am able to load a NIFTI file from the terminal using the open -a "Slicer" --args
command. But not from the web browser. I am on a macOS so I understand I need to manually associate the āslicer://ā custom URL protocol to the 3D Slicer application. I have appended the Info.plist file of the Application with the following
<key>CFBundleIdentifier</key>
<string>viewer</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>slicer</string>
<key>CFBundleURLSchemes</key>
<array>
<string>slicer</string>
</array>
</dict>
</array>
Is there anything else i should do for the web browser link to work? Really appreciate your help.
It looks good.
Iām not sure about the viewer
(it must be unique, so something like org.slicer.slicer
could be more appropriate) and you may need to double-click on the bundle to register this URL handler - see this page for some more details:
It is also possible that this only works for signed applications (Slicer Stable Releases), or you may need to move the application folder somewhere or restart the computer for the OS to pick up the plist file.
Note that we will work on registration of custom URL handlers for Slicer for Windows/Linux/macOS during the upcoming project week - see Project Description | NA-MIC Project Weeks
It would be nice to have some successful test of this working before the event, so if you have any updates (either that itās working or you have some errors) then please share.
Thanks so much for responding.
I made the following updates as per your suggestion
- Update
viewer
toorg.slicer.slicer
- Double click on the bundle
I ensured the other items from the article were in place too but I still couldnāt open a NIFTI image from the browser. Note that I tried this with the latest preview release of the 3D slicer i.e. 5.7.0
When I tried to use the latest stable release i.e. 5.6.1, it failed to load the image even from the terminal as the modification of the Info.plist file led to the app crashing.
Hi @Likitha_Shetty, stumbled upon this again as I wanted to read @lassoan suggestions again. I got slicer:// protocol registration to work on macOS.
Hereās the shell script that will do the registration.
macOSregistration (github.com)
Hereās how I extend @lassoan initial work, and integrate the above shell script to run with in slicer env, to register slicer:// protocol on Linux and Mac, download data from IDC and load to a scene. The below link may or may not be persistent as it will eventually live under ImagingDataCommons. But we do plan to contribute the registration process on Linux and MacOS in coming weeks or months to Slicer directly as we refine the behavior when a user has multiple versions of slicer.
Iām still very new to slicer dev but happy to help if anything is with in my reach.