This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
dataDir = "/opt/data/SlicerMorph/20231003-ColorizedVR" | |
segName = "Segmentation" | |
ctFullName = "deep_snail_2_14.9um_2k__rec1100" | |
ctName = "deep_snail_2_14" | |
try: | |
slicer.util.getNode(segName) | |
except slicer.util.MRMLNodeNotFoundException: | |
slicer.util.loadVolume(f"{dataDir}/{ctFullName}.nrrd") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
import numpy | |
import os | |
import random | |
includeEdema = True | |
exec(open("/opt/data/nac/neurosurgicalatlas/MONAI/labels.py").read()) | |
tureSynthSegGlob = "/opt/data/nac/neurosurgicalatlas/MONAI/Ture-subset-2022-12-03-nii-seg/Ture-*-*.nrrd_synthseg.nii.gz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
exec(open("/opt/data/nac/neurosurgicalatlas/ss2-Ture-028-registration.py").read()) | |
""" | |
import glob | |
from math import floor, ceil | |
import numpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
p = "/Volumes/GoogleDrive/My Drive/hacks/sardana.py" | |
exec(open(p).read()) | |
Screencapture of result posted here (slide 7): https://docs.google.com/presentation/d/12cDI-HHQ4OhNTN4oqx-yFiyPAqvDB5sxKrimrWgdAOY/edit?usp=sharing | |
""" | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
filePath = "/Users/pieper/slicer/latest/SlicerMorph/loadPointCloud.py" | |
modelPath = "/opt/tmp/georeferenced_model.vtk" | |
exec(open(filePath).read()) | |
""" | |
modelNode = slicer.util.loadModel(modelPath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Display zarr from s3 buckets for example data from here: | |
https://www.openmicroscopy.org/2020/11/04/zarr-data.html | |
exec(open("/Users/pieper/idc/ngff.py").read()) | |
see also: /Volumes/GoogleDrive/My\ Drive/hacks/sardana.py | |
https://gist.github.com/pieper/10ee6add544633f4c75dbb293ef087bc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Install wgpu as described here: https://github.com/pygfx/wgpu-py | |
Tested with Slicer 5.0.2 and wgpu 537c3eab68e9eef77681fc5545532380df26d8cc (basically 0.8.1) | |
exec(open("./slicer-compute.py").read()) | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
comment = """ | |
You can use this script with either Slicer's python wrapped VTK or with pip installed VTK like this: | |
~/Downloads/Slicer-4.13.0-2021-06-18-linux-amd64/bin/PythonSlicer vr-depth-crop.py | |
python vr-depth-crop.py | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pieper@hive Slicer-build % time make package | |
[ 0%] Built target ExtensionWizard-Resources | |
[ 0%] Built target SlicerPythonResources | |
[ 3%] Built target CopySlicerPythonScriptFiles | |
[ 3%] Built target CompileSlicerPythonFiles | |
[ 9%] Built target CopySlicerPythonResourceFiles | |
[ 12%] Built target SlicerData | |
[ 12%] Configuring vtkSlicerVersionConfigure.h | |
-- Configuring Slicer release type [Experimental] | |
-- Found Git: /usr/local/bin/git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
archiveFilePath = os.path.join(slicer.app.temporaryPath, "master.zip") | |
outputDir = os.path.join(slicer.app.temporaryPath, "SlicerImageStacks") | |
try: | |
os.remove(archiveFilePath) | |
except FileNotFoundError: | |
pass |
NewerOlder