Hi Claire,
I didn’t realise that the update sites no longer work with Fiji. The current Fiji plug-in can work without them but actually I’d suggest that you take a look at:
https://github.com/sandorbx/Parallel-Fij...
Sandor Kovacs is signed up to the list and may have more to add. I need to get our wiki visible again when I’m back. All the best,
Greg.
FWIW, if you are looking for instructions on how to use the command lines of some essential CMTK tools directly, there is a "User Guide" in the "Documents" section here on NITRC: https://www.nitrc.org/docman/index.php?group_id=212&selected_doc_group_id=710&language_id=1#folder
PDF is attached for convenience.
Best,
Torsten
Here's the type of thing I'm trying to write:
Follow the instructions at:
https://github.com/sandorbx/Parallel-Fij...
(This will require typing a few things into a command line but don't worry if you're not a coder, it will tell you what to do).
For the part that requires Ubuntu, note that it must be installed through the Microsoft Store, which can have problems if not recently updated through Windows Updates. Update, then reboot your computer.
When the instructions refer to the file named "Parallel_Fiji_CMTK_Registration***.ijm", that comes from a collection of files from the green "Code" button at the top of the instructions page. Download the ZIP then extract it, and move the relevant .ijm file for your operating system as outlined in the instructions.
If your confocal stack is not already separated out into different files for different channels, open it in Fiji. Scroll to a slice where you can see the brain.
>Image >Transform >Rotate >Check "Preview" >Change angle until brain is upright
Draw a box around brain but not too tightly
>Image >Crop
>Image >Color >Split channels
Select the nc82 reference channel image
>Save >NRRD >remove the leading characters that Fiji inserts, and give it a name ending in _01
Select the neuron stain image (e.g. GFP)
>Save >NRRD >choose exactly the same name as the reference image, but ending in _02
Check the FlyWire Gateway to see what template brains that site can work with, then download an appropriate one from:
https://www.janelia.org/open-science/jrc...
To run alignment in Fiji: >Plugins >Macros >Parallel Fiji CMTK Registration...
I think Torsten's guide is very useful when you use it while exploring CMTK in the command line, for example running the "cmtk --help" command, you can add the help options to any command to see what kind of operations and parameters you can use and what is the basic syntax, you can even find some basic explanations there. I encourage you to actually try the examples in the userguide, while reading the help pages, and experimenting with the options. CMTK real challange that it requires some understanding of the underlying image mathematics for effective use, coding is really just typing in the commands following the syntax on the help pages, maybe add some basic logic combining it with bash commands.
Originally posted by c_mckellar:
Here's the type of thing I'm trying to write:
Follow the instructions at:
https://github.com/sandorbx/Parallel-Fij...
(This will require typing a few things into a command line but don't worry if you're not a coder, it will tell you what to do).
For the part that requires Ubuntu, note that it must be installed through the Microsoft Store, which can have problems if not recently updated through Windows Updates. Update, then reboot your computer.
When the instructions refer to the file named "Parallel_Fiji_CMTK_Registration***.ijm", that comes from a collection of files from the green "Code" button at the top of the instructions page. Download the ZIP then extract it, and move the relevant .ijm file for your operating system as outlined in the instructions.
If your confocal stack is not already separated out into different files for different channels, open it in Fiji. Scroll to a slice where you can see the brain.
>Image >Transform >Rotate >Check "Preview" >Change angle until brain is upright
Draw a box around brain but not too tightly
>Image >Crop
>Image >Color >Split channels
Select the nc82 reference channel image
>Save >NRRD >remove the leading characters that Fiji inserts, and give it a name ending in _01
Select the neuron stain image (e.g. GFP)
>Save >NRRD >choose exactly the same name as the reference image, but ending in _02
Check the FlyWire Gateway to see what template brains that site can work with, then download an appropriate one from:
https://www.janelia.org/open-science/jrc...
To run alignment in Fiji: >Plugins >Macros >Parallel Fiji CMTK Registration...
If further troubleshooting is needed use this test data
https://www.dropbox.com/sh/54igm0xxmtlo4ei/AAA7EpGMZcoN_CMs8kG8zI26a?dl=0
-place test_data folder on one of your internal hard drives directly like "C:\test_data" , use the images and the reference provided to run a registration.
-confirm that CMTK installed, open ubuntu terminal and type the command cmtk --help , after hitting enter you should see the cmtk help page.
- on windows 10 the macro has the limitation that it can just read files on the internal hard drives and not from network or external drive locations
Hope this will help.
Follow the instructions at:
https://github.com/sandorbx/Parallel-Fij...
(This will require typing a few things into a command line but don't worry if you're not a coder, it will tell you what to do).
Where it says for Windows, "Start powershell as admin", do the following:
Press Windows+R to open Run, and then type "powershell" in the text box but don't press Okay, press Ctrl+Shift+Enter.
For the part that requires Ubuntu, note that it must be installed through the Microsoft Store, which can have problems if not recently updated through Windows Updates. Then reboot your computer. https://www.microsoft.com/en-us/p/ubuntu...
When the instructions refer to the file named "Parallel_Fiji_CMTK_Registration***.ijm", that comes from a collection of files from the green "Code" button at the top of the instructions page. Download the ZIP then extract it, and move the relevant .ijm file for your operating system as outlined in the instructions.
If your confocal stack is not already separated out into different files for different channels, open it in Fiji. Scroll to a slice where you can see the brain.
>Image >Transform >Rotate >Check "Preview" >Change angle until brain is upright
Draw a box around brain but not too tightly
>Image >Crop
>Image >Color >Split channels
Select the nc82 reference channel image
>Save >NRRD >remove the leading characters that Fiji inserts, and give it a name ending in _01. Make sure there are no white spaces anywhere in the file path or name. On windows 10 the macro has the limitation that it can just read files on the internal hard drives and not from network or external drive locations.
Select the neuron stain image (e.g. GFP)
>Save >NRRD >choose exactly the same name as the reference image, but ending in _02
Check the FlyWire Gateway: https://flywiregateway.pniapps.org/ to see what template brains that site can work with, then download an appropriate one from:
https://www.janelia.org/open-science/jrc...
To run alignment in Fiji: >Plugins >Macros >Parallel Fiji CMTK Registration.
Choose an operation: Affine & warp registration
Registration parameter preset: Full Flybrain
Select desired output directory (no spaces in path names), template brain location & output directory.
Check "Show results list" and check "Reformat channel 01, 02, 03"
In the Log window, scroll to the bottom to see if it's running ("Please wait")
After a period of time (that can take quite a while), the aligned files will appear as stacks in the output directory you selected.
If troubleshooting is needed use this test data:
https://www.dropbox.com/sh/54igm0xxmtlo4...
-Place test_data folder on one of your internal hard drives directly like "C:\test_data" , use the images and the reference provided to run a registration.
-confirm that CMTK installed, open ubuntu terminal and type the command cmtk --help , after hitting enter you should see the cmtk help page.
Maybe using the skip final resolution option can be useful for home computers, especially with high res samples, the registration quality is not affected negatively usually, and the compute time can be considerably faster.
If this is for teaching material I'm happy to give more feedback on it or offer additional help, just write me an email.
Hello - I am new to this forum and toolset and very grateful for you for putting together this instruction set. I followed the instructions and was able to install the macro for FIJI (Parallel FIJI CMTK Registration Mac20 on my mac), but I am getting an error with no reformatting (see below for details) even when I use the test dataset linked from the dropbox earlier in this thread. I have no coding experience, so I think I am the type of person you wrote these instruction for and I'd very much appreciate your help in getting te fly brain registration to work for me. Thank you so much
result from running macro:
Started Affine and Warp Registration on 1 samples
Preset: Full Flybrain(Cachero-Ostrovksy_2010)
Affine parameters:
Initial affine method: --centers-of-mass
Affine registration metric: Normalized Mutual Information
Exploration [Initial optimizer step size]: 16
Accuracy [Final optimizer step size]: 0.8
Degrees of freedom first pass: 6
Degrees of freedom second pass: 9
Warp parameters:
Warp registration metric: Normalized Mutual Information
initial exploration step size: 26
Accuracy [Final exploration step size]: 0.4
coarsest resampling: 8
Refine grid: 4
grid size: 80
Job list:
gehirn
(cmtk make_initial_affine --centers-of-mass
/Users/meilinwu/Desktop/test/refbrain/JRC2018_UNISEX_20xHR.nrrd
/Users/meilinwu/Desktop/test/images/gehirn_01.nrrd
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/gehirn_init.list;
cmtk registration --initial
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/gehirn_init.list
--nmi --dofs 6 --dofs 9 --nmi --exploration 16 --accuracy 0.8
--omit-original-data -o
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/gehirn_affine.xform
/Users/meilinwu/Desktop/test/refbrain/JRC2018_UNISEX_20xHR.nrrd
/Users/meilinwu/Desktop/test/images/gehirn_01.nrrd; cmtk warp --nmi
--threads 160 --jacobian-weight 0 --fast -e 26 --grid-spacing 80
--energy-weight 1e-1 --refine 4 --coarsest 8 --ic-weight 0
--accuracy 0.4 --omit-original-data -o
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/gehirn_warp.xform
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/gehirn_affine.xform;cd
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8;
cmtk reformatx --pad-out 0 -o Reformatted/warp_gehirn_01.nrrd
--floating /Users/meilinwu/Desktop/test/images/gehirn_01.nrrd
/Users/meilinwu/Desktop/test/refbrain/JRC2018_UNISEX_20xHR.nrrd
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/gehirn_warp.xform
& cd
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8;
cmtk reformatx --pad-out 0 -o Reformatted/warp_gehirn_02.nrrd
--floating /Users/meilinwu/Desktop/test/images/gehirn_02.nrrd
/Users/meilinwu/Desktop/test/refbrain/JRC2018_UNISEX_20xHR.nrrd
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/gehirn_warp.xform
& cd
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8;
cmtk reformatx --pad-out 0 -o Reformatted/warp_gehirn_03.nrrd
--floating /Users/meilinwu/Desktop/test/images/gehirn_03.nrrd
/Users/meilinwu/Desktop/test/refbrain/JRC2018_UNISEX_20xHR.nrrd
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/gehirn_warp.xform
) &
Please wait
(cmtk make_initial_affine --centers-of-mass
/Users/meilinwu/Desktop/test/refbrain/JRC2018_UNISEX_20xHR.nrrd
/Users/meilinwu/Desktop/test/images/gehirn_01.nrrd
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/gehirn_init.list;
cmtk registration --initial
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/gehirn_init.list
--nmi --dofs 6 --dofs 9 --nmi --exploration 16 --accuracy 0.8
--omit-original-data -o
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/gehirn_affine.xform
/Users/meilinwu/Desktop/test/refbrain/JRC2018_UNISEX_20xHR.nrrd
/Users/meilinwu/Desktop/test/images/gehirn_01.nrrd; cmtk warp --nmi
--threads 160 --jacobian-weight 0 --fast -e 26 --grid-spacing 80
--energy-weight 1e-1 --refine 4 --coarsest 8 --ic-weight 0
--accuracy 0.4 --omit-original-data -o
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/gehirn_warp.xform
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/gehirn_affine.xform;cd
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8;
cmtk reformatx --pad-out 0 -o Reformatted/warp_gehirn_01.nrrd
--floating /Users/meilinwu/Desktop/test/images/gehirn_01.nrrd
/Users/meilinwu/Desktop/test/refbrain/JRC2018_UNISEX_20xHR.nrrd
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/gehirn_warp.xform
& cd
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8;
cmtk reformatx --pad-out 0 -o Reformatted/warp_gehirn_02.nrrd
--floating /Users/meilinwu/Desktop/test/images/gehirn_02.nrrd
/Users/meilinwu/Desktop/test/refbrain/JRC2018_UNISEX_20xHR.nrrd
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/gehirn_warp.xform
& cd
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8;
cmtk reformatx --pad-out 0 -o Reformatted/warp_gehirn_03.nrrd
--floating /Users/meilinwu/Desktop/test/images/gehirn_03.nrrd
/Users/meilinwu/Desktop/test/refbrain/JRC2018_UNISEX_20xHR.nrrd
/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/gehirn_warp.xform
) & wait;
execution time was 0 s.
gehirn Registration warp failed
gehirn Registration affine failed
Reformat
failed:/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/Reformatted/warp_gehirn_01.nrrd
Reformat
failed:/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/Reformatted/warp_gehirn_02.nrrd
Reformat
failed:/Users/meilinwu/Desktop/test/result/gehirn_Registration_2026-1-13-13-8/Reformatted/warp_gehirn_03.nrrd
Reformatted 0 images
Hello - I am late to the game and very much a non-coder, but would really love to be able to register my fly brain images for use with platforms like Flywire. I followed the instructions above to install the FIJI plugin and it looked like it installed properly, but gives an error when I try the registration even with the test data provided above. I am at a loss as to how to move forward and was hoping for some guidace from the experts on this forum. Any advice would be greatly appreciated!!
Hi, thanks for the interest, was a long time I tested this on a mac, not even sure if bash commands like this are still working in the current shell. I will get back to you as soon as I figure it out.
Hi Sandor - thank you so much for taking the time to help me with this. Not sure if it is relevant, but I'm using a 5yr old macbook pro running macOS15.6.1. Processor is 2.4GH 8-core intel i9 with 32GB RAM. I was wonding if maybe the processor is not sufficiently powerful?
That should be sufficient, also good news that its an Intel chip, for the Apple silicon you would need Rosetta or an ARM build. In the meantime maybe you can confrim if you have a working CMTK install by running "cmtk --help" command in the terminal, or try some examples from the CMTK userguide :https://insight-journal.org/browse/publication/706/#manuscript
Sorry if this is posted multiple times, for some reason it doesn't seem to be showing up.
Thank you for the suggestion. When I enter that command, the response is:
-bash: cmtk--help: command not found
Does this mean the installation failed? I do believe something was installed because I can access the cmtk plugin in FIJI (see attachment)
Originally posted by mwu:
-bash: cmtk--help: command not found
Maybe this is just a typo in your post, but to be sure - there needs to be a space between `cmtk` and `--help` :)
Thanks! I wasn't sure so I did it with and without the space and got the same response.
Macintosh-62:~ meilinwu$ cmtk --help
-bash: cmtk: command not found
Macintosh-62:~ meilinwu$ cmtk--help
-bash: cmtk--help: command not found
I'm guessing that is not a good sign for me...
