loadVolume: how can I include properties like lablemap when loading?

Hi everyone!

i’m writing a script in python and I would like to set the labelmap to TRUE when loading a volume.
I can’t find the way to do it with the slicer.util.loadVolume(fileName, properties, returnNode) instruction.
I don’t konw how to pass the correct property!
I’m trying to load an atlas mask (atlasmask.mha) to perform a Swiss Skull Stripper process.
This is the line:
aMask = slicer.util.loadVolume(’/myroot/atlasMask.mha’, returnNode=True)

any clue on how to make it?

Thanks in advance!

Labelmaps have their own routine for loading, I think you need to use that instead of loadVolume.
You would need to write:
aMask = slicer.util.loadLabelVolume(’/myroot/atlasMask.mha’, returnNode=True)

1 Like

Hi again guys!!

ok…I’m very sorry :frowning: …the very second I went back to slicer after writing this post I begin typing and I saw this: slicer.util.loadLabelVolume()…

again…I’m sorry!!

I guess the “I’m new to slicer” excuse is worth it here, isn’t it?

Thaanks to anyone who’s read it :slight_smile:

ohh hey mangotee!!
Thanks a lot for replying…I’ll try to exhaust my options next time before asking :slight_smile:

Appreciate it!!

no problem :slight_smile: first time I’m able to ANSWER a question! Usually, I’m on the receiving end of things…

1 Like