Hello everyone,
I've been using VisuAlign as part of the QUINT workflow to adjust
slices registered to the Waxholm Space Atlas (using QuickNII 2.2.
with v4 of the Waxholm Atlas).
This has been working but I've come
across two issues now
1. for generation of hemibrain maps using QuickMaskNL, the
reference coordinates supplied on the Nutil documentation (https://nutil.readthedocs.io/en/latest/Q...)
appear to be for a mouse brain or at least not for v4 of the WHS
atlas.
I've managed to generate roughly fitting maps through trial and
error (coordinate string: 242 32.2 292.8 242 367.9 291.8 242 34.5
48.7) but I'd be grateful if anyone could explain what the
coordinates actually signify and how they were determined in the
first place so I might be able to replicate this for the WHS
atlas
2. I have a large number of brains (> 100) that I've registered
and now need to generate the hemibrain maps for. Is there any way
to automate QuickMaskNL for this? Manually entering all the info
for the location of the json files, etc. is cumbersom work I'd like
to avoid if at all possible
Hi,
The masking tool is a quick'n'dirty solution, the coordinates are the corners of a triangle from the cutting plane. Usually they're coming from QuickNII:
- open QuickNII, don't load any series
- set up the main view in the way how you want to cut the atlas into half
- read coordinates for 3 suitably distant points, e.g. move the mouse cursor somewhere in the top-left, read the coordinates (they're displayed in the purple title bar), then repeat this with top-right and bottom-center.
So in the given case the atlas is halved along the x=242 plane (all 3 points have this coordinate).
For mass-producing these masks you will have to use the command line, and that can be painful.
Setup:
- find a convenient location, if you're not familiar with navigating the command line, try creating a new folder in the root of a drive where you have write access (in Windows Explorer, navigate to "This PC" - will be different if Windows is set to German -, and check locations that have a drive letter, like C:, D:, etc.). Let's assume it's M: and the folder is called MaskTest
- download QNLpack.zip from https://www.nesys.uio.no/QNL/ and extract it. There is a single QNL folder inside, that's the one you will need to copy into the previously created MaskTest folder on the M: drive
- you will need Java, download it from https://openjdk.org/ - it's not friendly to the eye, but there's a link "jdk.java.net/23" in the middle of the second paragraph, that's where you can find the current downloads). Get the one for Windows, extract it, and right now it contains a jdk-23.0.2 folder, copy that into MaskTest too
- copy all of the JSON files you want to process into the same MaskTest folder.
So now MaskTest contains QNL and jdk-23.0.2 folders, and lots of JSON files.
Now start a command prompt, like open the Start Menu and type cmd. Probably it will arrive in your user folder, so type the drive letter where you have MaskTest, and a colon, then press Enter. In my case I type m:. Now type cd \MaskTest and press Enter. These two steps set the working location in the command prompt.
Here we can test if the installation works, first try jdk-23.0.2\bin\java --version to see if Java works properly, and then try jdk-23.0.2\bin\java -cp QNL qnlmask.QuickMask to check if QuickMaskNL works too. Then just close it.
If everything worked so far, two steps remain:
- creating output folders for every JSON: for %f in
(*.json) do mkdir "%~nf"
- and running the tool: for %f in (*.json) do
jdk-23.0.2\bin\java -cp QNL qnlmask.QuickMask "%f" 242 32.2 292.8
242 367.9 291.8 242 34.5 48.7 "%~nf"
In the download location there's a screenshot of the ideal case too (I processed only 2 files), though it won't do much if anything goes wrong.
I hope this helps, best regards:
Gergely
Hi Gergely,
thanks a lot for the detailed reply and apologies for my late
response (the email notifying about the post was deemed spam by our
university filter...).
Thanks for explaining how the coordinates come about. I tried to
retroactively confirm the trial-and-error ones I came up with using
QuickNII and I think I get it.
For anyone that stumbles upon this: it appears in the example
coordinates given "left" is posterior location, while "right" is
anterior (to me this was counter intuitive but inverting them also
works). It's also explained a bit here Protocols Step 21
Originally posted by Gergely Csucs:
Setup:
- find a convenient location, if you're not familiar with navigating the command line, try creating a new folder in the root of a drive where you have write access (in Windows Explorer, navigate to "This PC" - will be different if Windows is set to German -, and check locations that have a drive letter, like C:, D:, etc.). Let's assume it's M: and the folder is called MaskTest
- download QNLpack.zip from https://www.nesys.uio.no/QNL/ and extract it. There is a single QNL folder inside, that's the one you will need to copy into the previously created MaskTest folder on the M: drive
- you will need Java, download it from https://openjdk.org/ - it's not friendly to the eye, but there's a link "jdk.java.net/23" in the middle of the second paragraph, that's where you can find the current downloads). Get the one for Windows, extract it, and right now it contains a jdk-23.0.2 folder, copy that into MaskTest too
- copy all of the JSON files you want to process into the same MaskTest folder.
So now MaskTest contains QNL and jdk-23.0.2 folders, and lots of JSON files.
Now start a command prompt, like open the Start Menu and type cmd. Probably it will arrive in your user folder, so type the drive letter where you have MaskTest, and a colon, then press Enter. In my case I type m:. Now type cd \MaskTest and press Enter. These two steps set the working location in the command prompt.
Here we can test if the installation works, first try jdk-23.0.2\bin\java --version to see if Java works properly, and then try jdk-23.0.2\bin\java -cp QNL qnlmask.QuickMask to check if QuickMaskNL works too. Then just close it.
If everything worked so far, two steps remain:
- creating output folders for every JSON: for %f in (*.json) do mkdir "%~nf"
- and running the tool: for %f in (*.json) do jdk-23.0.2\bin\java -cp QNL qnlmask.QuickMask "%f" 242 32.2 292.8 242 367.9 291.8 242 34.5 48.7 "%~nf"
Thank you very much for sharing this in a very beginner friendly
way!!
I'll give it a go today but at first glance it seems doable even
for someone with my non-existent java knowledge.
Cheers
Janine