general > Using a Custom Atlas in QuickNII
Showing 1-10 of 10 posts
Display:
Results per page:
Apr 30, 2025  01:04 PM | Lindsey Ching
Using a Custom Atlas in QuickNII

Hello, I'm interested in using a custom atlas in QuickNII. I ran the script from https://github.com/HumanBrainProject/Qui... (found at the bottom of https://www.nitrc.org/plugins/mwiki/inde...) to create my own .cutlas file.


Where should I place this file so that it I can load it in QuickNII? I've tried placing it in ~/QuickNII-ABAMouse-v3-2017.app/Contents/Resources, since I saw ABA_Mouse_CCFv3_2017_25um.cutlas in this directory, but it's not showing up in the drop-down atlas menu.


Any help would be appreciated!

Apr 30, 2025  02:04 PM | Gergely Csucs
RE: Using a Custom Atlas in QuickNII

Hi,


I don't have the Mac version of QuickNII in front of me, but somewhere inside there's a file called pack.txt (most probably it's at the exact same location where you found ABA_Mouse_CCFv3_2017_25um.cutlas), it contains the name of the cutlas file QuickNII will attempt to load. It contains the filename only, not even a line break after it.


I hope this helps, best regards,


Gergely

Apr 30, 2025  06:04 PM | Lindsey Ching
RE: Using a Custom Atlas in QuickNII

Hi Gergely, 


Thanks for the info! I'm getting this error, even though I confirmed the file is in the expected location: 
"STDERR:Exception in thread "main" java.io.FileNotFoundException: /Applications/QuickNII-ABAMouse-v3-2017.app/Contents/Resources/CCFv3_2020_10um.cutlas
 (No such file or directory)"


I also tried changing pack.txt back to "ABA_Mouse_CCFv3_2017_25um.cutlas" and it returned the same file not found error.

May 16, 2025  09:05 AM | Gergely Csucs
RE: Using a Custom Atlas in QuickNII

Hi,


This likely means that the text editor put some extra character(s) in the file. Possibly a line break at the end. Trying with a source code editor may help, perhaps.


Best regards,


Gergely

Nov 10, 2025  06:11 PM | Janine Reinert
RE: Using a Custom Atlas in QuickNII

I am also trying to use QuickNII with a custom atlas (specifically marmoset and rhesus macaque) data.

However, just as a proof of principle I tried to generate the *.cutlas file using the QuickNII extras and the Waxholm atlas data V4 instead (found here on this nitrc site) of the V2 used in the demo and it keeps throwing an error at the 'Compressing Segmentation' stage.

The error is this:
'Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because the return value of "java.util.Map.get(Object)" is null'
The code does work nicely with the WHS V2 data it's meant to be used with but I can't figure out what has changed in the v4 data (except for having more regions).

Considering this isn't working: would it even be possible to use segmented monkey data in QuickNII? Monkey data would include the MRI, segmentation and labels but no DTI (i.e. dataset like this)

Any help would be greatly appreciated. QuickNII worked great for us for mice and rats so if I can continue using it for our monkey data, that would be fantastic.

Nov 11, 2025  06:11 PM | Gergely Csucs
RE: Using a Custom Atlas in QuickNII

The WHSv4 atlas has 16-bit identifiers now (while piecewise they still would fit into 8 bits, their value range goes beyond 500 already). That's quite the change, I'll try to post an updated example tomorrow.

Nov 12, 2025  09:11 AM | Janine Reinert
RE: Using a Custom Atlas in QuickNII

Probably a mistake on my part relying simply on Fiji. At least there, both V2 and V4 are shown as being 16bit but the value ranges are indeed very very different.

As this was more or less just meant as a trial to see if I can get QuickNII running with a 'custom' segmentation: do you think it can work with i.e. the data provided here: https://www.nitrc.org/projects/inia19?

Nov 12, 2025  04:11 PM | Gergely Csucs
RE: Using a Custom Atlas in QuickNII

Fiji is correct, the volume itself is 16-bit, but it contained 8-bit values only, and the example encoder knew about this.


Now there's a PackWHSRatV4Demo.java file too.


Looked at the inia19 dataset, and generally it will work with QuickNII, as the most important restriction of QuickNII is the isotropic voxel size. Smaller hiccups are expected though: the label file format is different from ITK (so a modified parser is needed), and the orientation is LPI (axis order matches, but all axes are in the opposite direction compared to what QuickNII will display).

Nov 23, 2025  07:11 PM | Janine Reinert
RE: Using a Custom Atlas in QuickNII

Dear Gergely

first off: thank you very much for the fast help! So very quick.

With your hints I managed to actually produce a working *.cutlas file with the inia19 dataset.
The last thing I'd like to do (if possible) is to remove the DTI data from the file as we don't need it for registration and most monkey datasets don't even come with DTI data.
However, if I don't include it in the cutlas, QuickNII throws an 'Array out of bounds' error so I'm guessing it will always expect the *.cutlas file to have 7 volumes total in the original order (i.e. 2 volumes MRI, 3 volumes DTI, 2 volumes Segmentation)?

Cheers
Janine

Nov 24, 2025  11:11 AM | Gergely Csucs
RE: Using a Custom Atlas in QuickNII

Hi Janine,


There can be multiple things in play:



  • https://github.com/Neural-Systems-at-UIO/QuickNII-extras/blob/master/Java/PackWHSRatV4Demo.java#L218 tells the total number of (byte) volumes present in the file (it's 7 for this rat: 2 for MRI -16 bit grayscale-, 3 for DTI -24 bit RGB-, and 2 for the segmentation -16 bit indexed-, in this order)

  • the modality headers contain volume indices: https://github.com/Neural-Systems-at-UIO... says MRI starts with 0 (its type in line 61 above defines it's 16-bit grayscale), then line-pair 77-82 specifies the DTI (starting at volume index 2), and lines 86 and 92 tell about the segmentation.


Nice job packing the atlas with so little documentation, and I hope these points will help with the final cleanup.
We have a very tiny editor for the description text that appears in the about box, should you need one: https://www.nesys.uio.no/QuickNII-About/ is its location (it opens a cutlas file, and then saves the result into the download folder of the browser, usually).


Cheers,
Gergely

  Edited (Nov 24, 2025  11:11 AM)