I successfully changed the 3D view background color and the left-click and drag to window/level when starting slicer.
Unfortunately, I can’t see what goes wrong with the following (copied and paste directly from notepad):
# Change default overwrite setting in segment editor
defaultSegmentEditorNode = slicer.vtkMRMLSegmentEditorNode()
defaultSegmentEditorNode.SetOverwriteMode(slicer.vtkMRMLSegmentEditorNode.OverwriteNone)
slicer.mrmlScene.AddDefaultNode(defaultSegmentEditorNode)
# Save LabelMaps as Nifti (.nii.gz)
requiredFileExtension = '.nii.gz'
originalFileExtension = '.nrrd'
volumeNodes = slicer.util.getNodesByClass('vtkMRMLLabelMapVolumeNode')
for volumeNode in volumeNodes:
volumeStorageNode = volumeNode.GetStorageNode()
if not volumeStorageNode:
volumeNode.AddDefaultStorageNode()
volumeStorageNode = volumeNode.GetStorageNode()
volumeStorageNode.SetFileName(volumeNode.GetName()+requiredFileExtension)
else:
volumeStorageNode.SetFileName(volumeStorageNode.GetFileName().replace(originalFileExtension, requiredFileExtension))