GithubHelp home page GithubHelp logo

perklab / slicersandbox Goto Github PK

View Code? Open in Web Editor NEW
60.0 60.0 23.0 6.34 MB

Collection of utilities that are not polished implementations but can be useful to users

License: BSD 2-Clause "Simplified" License

CMake 4.23% Python 67.05% C++ 28.72%

slicersandbox's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

slicersandbox's Issues

Button to unset/reset light settings

Currently there is no option to go back to original light settings. Consider implementing a button to revert back to defaults (or a way to unset them).

Unable to build the 3d slicer module

I had built Slicer Sandbox and Slicer github module using make file and build cmake commands.
But Qt5 is unable to build even though the python modules pyqt5 and slicer are very much installed.
Qt5 is not open source. I need help here. Any other suggestion on how to build the sandbox remove ct table module.

Enable ColorizeVolume to work with already existing RGB volume

I have saved the color volume output from the ColorizeVolume to disk. However, I still have to load the original intensity image and the segmentation, next time when I need to work on in Slicer. It would be nice to have load data from scene/disk option. I like the controls in ColorizeVolume better than the VR ones, so would like to keep using them.

User statistics module slows down the application

User feedback (https://discourse.slicer.org/t/new-module-for-measuring-user-statistics/9220/5):
"One time, I did try enabling collection of user statistics, and a few minutes later, I was struck by how slow and unresponsive Slicer had become. After unchecking the UserStatistics “Enable” button and restarting Slicer, the application was responsive again, as usual. I did not do any further testing, but it was suspiciously correlated with my only attempt at enabling collection of user statistics."

Update NumPyDataLoader to provide axis option

This issue was created to document improvements to NumPyDataLoader contributed through:

and originally discussed in:


Originally posted by @dzenanz in Slicer/Slicer#6733 (comment), Slicer/Slicer#6733 (comment), Slicer/Slicer#6733 (comment) and Slicer/Slicer#6733 (comment)

My principal motivation for this PR is desire to easily and conveniently visualize dumps of NCHW 4D tensors. Having an option to load them as "channel last/fastest" would be nice, but I really want PyTorch's convention to be the default.

Even when reordering the axis for channel to be last, with the updated reader, I get an all-black image of "4 components". Visualizing something (vector norm, component average, or even just the first component) would be more useful than an all-black image.

Also, we could employ heuristic: the dimensions with largest size could be considered to be spatial. So (10, 4, 368, 640) would be interpreted as 4D image with 4 timepoints and 3D size of 640x368x10 (ijk). Prefer timepoints over components unless size is 3, which can be easily visualized as RGB.

Of course, all of these complications stem from .npy not having suitable metadata.

Originally posted by @lassoan in Slicer/Slicer#6733 (comment)

We could have auto, NCDHW, NKJIC axis options. Auto could implement the heuristics you described.

My only concern is that if sooner or later users will report that the loader randomly breaks. We experienced this with ITK, as ITK vector image reader has such heuristic, too. We were shocked when after being annoyed by seemingly random load failures for a long time we realized that loading fails for all data sets that have 3 or 4 time points simply because it is interpreted as channel data instead of time sequence.

Not much better, but maybe a bit more predictable heuristic could be to decide based on (composite) file extension. For example, something.torch.npy could make NCDHW order the default.

Why don't you save the result using pynrrd? You could use nrrd.write and specify the axis kinds like this:

nrrd.write("test.nrrd", a, {'kinds': ['RGB-color', 'domain', 'domain']})

How do you load the image into Slicer? Drag-and-drop is pretty tedious and it also shows the loaded image by default (there is no way to update an existing image). You could solve both tedious drag-and-drop and setting axes by using slicerio:

np.save("path/to/myfile.npy", someTensor),
nodeID = slicerio.server.file_load("path/to/myfile.npy", "NumpyArrayFile", {'axes': 'NCDHW'})

slicerio.server.file_load loads a data set in Slicer (if Slicer is not running then it launches it). If you load the node from a standard file format then you can reload it by simply calling slicerio.server.node_reload(id=nodeID).

Requested an insecure image

When in the extension manager for Slicer 5.1.0-2022-07-04, if I click on the image for Sandbox, I get errors on the command line, and it does not open the Sandbox page.

Errors are of the sort

"https://extensions.slicer.org/view/Sandbox/31077/linux" 0 "Mixed Content: The page at 'https://extensions.slicer.org/view/Sandbox/31077/linux' was loaded over HTTPS, but requested an insecure image 'http://www.slicer.org/slicerWiki/images/c/c2/VolumeClipLogo.png'. This content should also be served over HTTPS."
Mixed Content: The page at 'https://extensions.slicer.org/view/Sandbox/31077/linux' was loaded over HTTPS, but requested an insecure image 'http://www.slicer.org/slicerWiki/images/c/c2/VolumeClipLogo.png'. This content should also be served over HTTPS.

Add CombineModels function RobustBooleanOperation

RobustBooleanOperation will transform one of the inputs with a small pose variation to get the boolean operation to succeed

The syntax should be:

RobustBooleanOperation(
    inputMesh1,
    inputMesh2,
    resultingMesh,
    mmTranslationDelta=1e-4,
    degRotationDelta=1e-2,
    transformTries=15,
    randomSeed=None
)

Feedback is welcomed
I think I could develop this on the near future so you could assign it to me

Thank you

Feature Request: Apply ColorizeVolume to all items of a sequence

If the selected Volume and Segmentation belong to a Sequence, I would want the Colorized Volume to be generated for each frame of that sequence, and the Colorized Volume to be tracked within that sequence. So far, I would have to do apply my settings manually for each individual frame which is quite tedious.

The user should be prompted if they want to apply changes to the whole Sequence. We could use a Checkbox "Colorize whole Sequence" that is disabled for atomic volumes (not part of a Sequence) and enabled for Sequential Volumes+Segmentations.

I created this PR in SlicerTotalSegmentator which has a similar behavior, but for creating the segmentation:

lassoan/SlicerTotalSegmentator#56

If I use it to generate a 4D segmentation, I would like to use ColorizeVolume to create a 4D visualization of that sequence automatically.

SSAO Prevents Volume Rendering in Managed View

When SSAO is enabled in the latest version of the Lights module (stable or nightly release), volume rendering isn't displayed at all in the 3D views. This is not affected by the "Shadows for volume rendering" option.

Running the following code will reproduce the issue:

lightsLogic = slicer.modules.lights.widgetRepresentation().self().logic
lightsLogic.setUseSSAO(True)
for viewIndex in range(slicer.app.layoutManager().threeDViewCount):
    viewNode = slicer.app.layoutManager().threeDWidget(viewIndex).threeDView().mrmlViewNode()
    lightsLogic.addManagedView(viewNode)
    viewNode.SetOrientationMarkerType(viewNode.OrientationMarkerTypeCube)

import SampleData
mrHead = SampleData.SampleDataLogic().downloadMRHead()
slicer.modules.volumerendering.logic().CreateDefaultVolumeRenderingNodes(mrHead)

There also seems to be a rendering issue with the orientation marker when SSAO is enabled. as the frontface of the orientation markers are now culled:
image image

Additionally, if there are multiple 3D views in the current layout that are being managed by the Lights module, then all but one of them will stop rendering. Interacting with the broken views will cause the one working view to become transparent (you can see the window behind Slicer).

image

Add Cross-sectional area measurement computation along any physical axis

Measurement currently does not happen along anatomical axes but IJK axes (row, column, slice). It would be nice if anatomical directions (axial, sagittal, coronal) would be supported and even nicer if direction could be specified for example by a markups line.

This would require resampling of the volume along the chosen axis.

readPlist removed in python 3.9 - unable to use ImportOsirix ROI

As discussed in https://discourse.slicer.org/t/problems-using-importosirixroi-from-the-sandbox-extension/31406, ImportOsirixROI functionality appears to be broken.

"[...]/AppData/Local/slicer.org/Slicer 5.4.0/slicer.org/Extensions-31938/Sandbox/lib/Slicer-5.4/qt-scripted-modules/ImportOsirixROI.py", line 284, in importOsirixRoiFileToSegmentation

[CRITICAL][Stream] 28.08.2023 11:25:17 [] (unknown:0) -     inputRoiData = plistlib.readPlist(inputRoi)

[CRITICAL][Stream] 28.08.2023 11:25:17 [] (unknown:0) - AttributeError: module 'plistlib' has no attribute 'readPlist'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.