Skip to content

Instantly share code, notes, and snippets.

@dzenanz
Last active August 29, 2015 14:16
Show Gist options
  • Save dzenanz/bec172bd4af1f1527cf1 to your computer and use it in GitHub Desktop.
Save dzenanz/bec172bd4af1f1527cf1 to your computer and use it in GitHub Desktop.
fgm=slicer.modules.brainsroiauto
fgmPar={}
fgmPar["cropOutput"]=True
fgmPar["inputVolume"]=movingImage
fgmPar["outputVolume"]=movingImage
slicer.cli.run(fgm, None, fgmPar, True)
fgmPar["inputVolume"]=fixedImage
fgmPar["outputVolume"]=fixedImage
slicer.cli.run(fgm, None, fgmPar, True)
#the above is NOT equivalent to reg1params["maskProcessingMode"]="ROIAUTO"
reg1params={}
reg1params["initializeTransformMode"] = "useMomentsAlign"
reg1params["samplingPercentage"] = 0.02
reg1params["numberOfHistogramBins"] = 20
reg1params["translationScale"] = 5000
reg1params["fixedVolume"] = fixedImage
reg1params["movingVolume"] = movingImage
reg1params["transformType"] = "Rigid"
reg = slicer.mrmlScene.CreateNodeByClass("vtkMRMLLinearTransformNode")
reg.SetName("imageRegistrationTransform")
reg1params["linearTransform"] = reg
slicer.mrmlScene.AddNode(reg)
slicer.cli.run(slicer.modules.brainsfit, None, reg1params, wait_for_completion = True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment