dokay1
(Dave O Kay)
July 12, 2022, 1:08pm
1
For those looking for a script for Batch co-reg. You still have to add the string “FIXED” (case sensitive) to the name of the volume you want to use as the reference/fixed volume for co-registration.
PoolOfVolumes = getNodesByClass('vtkMRMLScalarVolumeNode')
FixedVol = getNode('*FIXED*')
for MovingVol in PoolOfVolumes:
slicer.util.selectModule('BRAINSFit')
brainsFit = slicer.modules.brainsfit
parametersRigid = {}
parametersRigid["fixedVolume"] = FixedVol.GetID()
parametersRigid["movingVolume"] = MovingVol.GetID()
parametersRigid["outputVolume"] = MovingVol.GetID()
parametersRigid["useRigid"] = True
parametersRigid["initializeTransformMode"] = "useGeometryAlign"
parametersRigid["samplingPercentage"] = 0.02
cliBrainsFitRigidNode = slicer.cli.run(brainsFit, None, parametersRigid)
Tested and works on Slicer 5.0.2 r30822 / a4420c3 on MacOS 12.4 using brain MRIs.
Cheers,
Dave
1 Like
dokay1:
brainsfit
Where can I find all the parameter names (like samplingPercentage etc)?
pieper
(Steve Pieper (Isomics, Inc.))
September 9, 2024, 2:36pm
3
https://slicer.readthedocs.io/en/latest/user_guide/modules/brainsfit.html
and
<?xml version="1.0" encoding="utf-8"?>
<executable>
<category>Registration</category>
<title>General Registration (BRAINS)</title>
<description>Register a three-dimensional volume to a reference volume (Mattes Mutual Information by default). Method described in BRAINSFit: Mutual Information Registrations of Whole-Brain 3D Images, Using the Insight Toolkit, Johnson H.J., Harris G., Williams K., The Insight Journal, 2007. http://hdl.handle.net/1926/1291</description>
<documentation-url>https://slicer.readthedocs.io/en/latest/user_guide/modules/brainsfit.html</documentation-url>
<license>https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt</license>
<contributor>Hans J. Johnson (hans-johnson -at- uiowa.edu, http://www.psychiatry.uiowa.edu), Ali Ghayoor</contributor>
<acknowledgements><![CDATA[Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3); Andriy Fedorov(5); Ali Ghayoor(4) 1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard]]> </acknowledgements>
<version>5.8.0</version>
<parameters advanced="false">
<label>Input Images</label>
<image>
<name>fixedVolume</name>
<longflag>fixedVolume</longflag>
<label>Fixed Image Volume</label>
<description>Input fixed image (the moving image will be transformed into this image space).</description>
<channel>input</channel>
<default></default>
This file has been truncated. show original
1 Like