How to modify .py extension script and load it by defualt

Can someone please tell me how to load a extension with the defaults values i want ? I have no knowledge in python or 3D Slicer python scripts.

I need to load CMF surface registration module with landmark set to 1000 by default.

The python script is in

~/.config/NA-MIC/Extensions-28562/CMFreg/lib/Slicer-4.11/qt-scripted-modules

i tried edition SurfaceRegistration.py at that location

    **self.numberOfLandmarksValueChanged = 200** and change it to  **self.numberOfLandmarksValueChanged = 1000** 

but i don’t know how to load this modified script to 3D Slicer

Also in the CMF registraion module maximum landmarks thta i can select is 2000. Is it possible to increase this value to 4000 ?

thanks

Figured it out…:stuck_out_tongue:

If others come across this problem in the future: you can edit the .py file, save it, restart Slicer. If you enable Developer mode (in menu: Edit / Application settings / Developer) then developer tools appear at the top of scripted modules, which allow you to open the .py of the module by a single click and reload the module without restarting Slicer.

I did it via developer mode. i asked the question when i edited and save the .py and restart the slicer, the changes i made did not take effect. It still does not in that way. But for me the developer mode solved my problem.
i even uninstall the cmf reigstration module and manually installed it with the edited py file in place still it did not work.

Any ideas why saving and restarting the program does not work ?

If changing a .py file does not have an effect then most likely you have added multiple versions of the same file to the module paths (e.g., files were already bundled with Slicer and you installed another copy manually or via extension manager). If you search for files with the exact same name on your entire computer then most likely you’ll find the duplicate.

Thank you for your reply. i think it worked.