Skip to content

Scripted utility to load image stacks (e.g. confocal microscopy) more easily

License

Notifications You must be signed in to change notification settings

smrolfe/SlicerImageStacks

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SlicerImageStacks

Scripted utility to load image stacks (e.g. confocal microscopy) more easily

For testing, paste this in the python console of a recent slicer nightly:

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

try:
    shutil.rmtree(outputDir)
except FileNotFoundError:
    pass

os.mkdir(outputDir)

slicer.util.downloadAndExtractArchive(
    url = "https://github.com/pieper/SlicerImageStacks/archive/master.zip",
    archiveFilePath = archiveFilePath,
    outputDir = outputDir)

modulePath = os.path.join(outputDir, "SlicerImageStacks-master", "ImageStacks", "ImageStacks.py")
factoryManager = slicer.app.moduleManager().factoryManager()

factoryManager.registerModule(qt.QFileInfo(modulePath))

factoryManager.loadModules(["ImageStacks",])

slicer.util.selectModule("ImageStacks")

About

Scripted utility to load image stacks (e.g. confocal microscopy) more easily

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 87.5%
  • CMake 12.5%