I’m back with more silly questions
using the examples of using segment editor have been really helpful, the issue I have been running into, however, is using an image that is not the sample image.
Just dragging in an image and avoiding anything that uses ‘masterVolumeNode’ was my original plan, but I am unable to apply the threshold on the image of interest if I do it that way.Same with pulling in the image and setting it as the master volume manually on segment editor. So I did some digging to try and find out how to load in my own image the correct way and found this:
masterVolumeNode = slicer.util.loadVolume('C:/Users/m222222/Dropbox/BRAIN_MASK.nii.gz’, returnNode=True)
(the path is similar to my actual path)
and it doesn’t complain at me, but it also doesn’t open the file, and when I tried to run things anyways, after
I got an error that I needed a VTK object, and after
it also said that I needed a VTK object
if I run it without those 2 lines, it complains at the end on ‘effect.self().onApply()’ and says…
Traceback (most recent call last):
File “”, line 1, in
File “/Applications/Slicer.app/Contents/lib/Slicer-4.10/qt-scripted-modules/SegmentEditorEffects/SegmentEditorEffects/SegmentEditorThresholdEffect.py”, line 351, in onApply
AttributeError: ‘NoneType’ object has no attribute ‘GetImageToWorldMatrix’
To be honest, I really don’t know what I’m doing on the coding front, so even simple things like loading images are rough, which is why I’m here.
I’m just confused and would like to know the correct way to load a master volume so the sample works with a novel image.