Superimpose atlas image onto microscope picture

imagej

#1

Hi all,
I’m new in this forum and I’m a beginner with ImageJ.
My question(s) regards how to superimpose rat brain picture (from Paxinos Brain Atlas) onto microscope rat brain image, because I need to count cells in specific brain regions. I knew how to draw line with ImgaeJ but this method is not so accurate. The most accurate method it will be superimpose atlas panel picture onto microscope image. I have watched tutorials on youtube and read articles as well as user manual, but still I cannot figure out how to do it. Furthermore, I cannot manage on how to register properly atlas picture with my interested brain slice, in order to avoid any deformation which can compromise the outcome of cell count. Can you help me to manage with this?
The atlas picture, which has a well defined brain regions, should be transparent and just only the dashed lines should remain in order to have precise brain regions outline.
I am working with ImageJ which run on Windows 7.

Since I am a new user I cannot attacha ny file, but I will share with all of you a link to google drive folder, in which you can find the both pictures:
https://drive.google.com/drive/folders/16LWl010sHUZgic2-ZzKvx96f2FziYIcy?usp=sharing

Your help will be really appreciated.

I hope I was clear enough.

Many thanks.

Cheers.


#2

Hello @SimMem and wellcome to the forum!

Just curious : do you have a link for this atlas ? Can you only get a tif file format for the atlas or are there vectorial images (svg for instance) available ?


#3

Hello NicoKiaru,

thanks for welcoming me in this forum.

I do not have a link for the atlas, but at the link I posted in my topic you can find both microscope as well as atlas pictures. Both are .tif file. I am sorry, but I do not know if they are vectorial images.


#4

Hum, but where did you get the atlas file ? If you provide a website link, I could check if there are alternative file formats.

To be fair what you ask for is not very straightforward with ImageJ. We have a workaround in our facility where we use OnTopReplica, but that’s not ideal, and it works only with Windows (https://c4science.ch/w/bioimaging_and_optics_platform_biop/computers-servers/software/ontopreplica/). The documentation is sparse, if you’d like to know more I can give more details.

Maybe others have better options…


#5

Hi,

my supervisor shared with me that file. I have only the link to buy it, not to get the pdf file.

I guessed that my question(s) would not be so easy to answer. Do you think if I use OnTopReplica then I could manage with superimpose the images?
Anyway, it will be a pleasure if you could share some info with me.
Thanks a lot!


#6

You could do this in a few steps:

a- align the atlas with the image

b- select the region you’re interested in. (and/or save it to file)

c- prepare the rat image for analysis (bkg sub, thresholding)

d- use “restore selection” on your rat image (or load it from the file)

e- perform “analyze particles” while the selection is active.

For step a I would suggest TurboReg and a rigid or affine transform, in manual mode. It will require you to manually move two or three (depending on what transform you are using) reference points on each image. The source is the atlas, the target is the mouse brain image. Once applied, you will get an aligned version of the atlas, that you can use to perform step b. You might have to convert the atlas image to 8-bit first.

Cheers

Thomas


#7

Hi @SimMem,

I don’t have much to add to @Thomas_Pengo 's great suggestion, except with a bias toward a tool I wrote we’re calling bigwarp. It lets you align / warp the atlas to your image on the fly (manually), and visualizes images together. In a minute, I was able to produce:

though I obviously don’t know rat anatomy :man_shrugging:

A quick gotcha, I had to run this quick script on your atlas to make visualization easier.

run("Split Channels");
selectWindow("Figure 6 rata brain atlas.tif (red)");
run("Invert");

Let me know if you want to give it a try and I’m happy to help,
John


#8

Looks super nice! But I feel stupid because I can’t put any landmark…
One just need to hold spacebar and left click sequentially in the big dataviewer windows ?

Nothing shows up. Neither on the image nor on the table. What could I be missing ? Keyboard layout ? Should I press on the original image windows ?

I tried left click and right click… But whether I hold space or not, I rotate the image with a left click and drag the image with a right click.

When I press T, I just get an error message because, of course, no deformation can be estimated.

Thanks!

Nico


#9

Thanks @NicoKiaru,

No, not your fault at all, I just forgot about this. It sounds like you ran into a bug someone found awhile ago. It’s fixed, but the new version hasn’t made it to the update site yet.

To get the fix, just replace the bigwarp jar in your fiji plugins folder with the newest release, downloadable from here.

In this new release, you tap Space to enter “landmark mode” and tap it to exit.*

John

*In older releases, holding space down is how you placed landmarks.

Edit: wording


#10

@NicoKiaru @bogovicj @Thomas_Pengo thanks a lot, to both of you, for your advice.
So, basically, to do want I want to do I need:

  • download both the plugins TurboReg and bigwarp;
  • open both images with ImageJ/FIJI;
  • modify the atlas picture (make it transparent) using TurboReg;
  • with bigwarp I will align/warp the atlas to my image;
    So once I complete such path, I will have a picture as @bogovicj attached, am I right?
    Your advice make me in a very good mood…now I will try to apply your advice, I will let you know if I was able to do it!

Thanks a lot!

Cheers


#11

Hi @SimMem,

If you’re using Fiji, then you don’t need to download bigwarp, you already have it. ( Plugins > BigDataViewer > Big Warp ).

You won’t need both TurboReg and Bigwarp, just one. They both will let you do step ‘a’ in @Thomas_Pengo’s list above. i.e. both TurboReg and Bigwarp let you align images to each other.

There are other steps that you’ll need to do to get regions of interest / selections from the atlas. (steps c and d above), though those should be straightforward.

Give the alignment a try, and then post back if you’re having trouble with next steps.

John


#12

hi @bogovicj,

Thanks a lot for your explanation.

Now I am trying to align with BigWarp, but when I select it and the two images were opened, appear also a dialog window in which is wrote:
WARNING:
Opening dataset that is not suited for interactive browsing.
Consider resaving as HDF5 for better performance.
So I cannot select the landmarks point in the moving image. Can I have some clue about it?

I am aware I am asking a lot of question, but for me this kind of things are quite new.

Your help is well appreciated.

Thanks a lot.

Simone


#13

Hi @SimMem
That’s also very interesting to me so I played with BigWarp. I did a small screencast with your data, and I will share it within in an hour.

For the error message, you just don’t need to care.

Best


#14

Hi @NicoKiaru,

thanks for sharing.

With the error windows seems that the program does not allow me to do anything more. Maybe is due to my inexperience. I will figure out something.

Best


#15

Have you tried to press space and click on the images ? Can’t you put a ‘red’ point on the open images ?

If not, you may have the same problem than me. In that case just do what @bogovicj wrote:

Here’s the promised screencast:

(Note: do a lot of mouse wheel movement down = downscaling, when pressing T)

I find this plugin awesome, but there are a few unatural things to handle with bigdataviewer. So don’t hesitate to ask if you have problems reproducing this. Carry on! The result is worth it.


#16

Hi @NicoKiaru @bogovicj @Thomas_Pengo

thanks to your advice I was able to superimpose the outline onto microscope image. I need to practice more to make more precise the outline, but the big part of the job is done.
It was not neither hard, nor so immediate, but thanks to all of you and to your FIJI skills I did it!!!
I will continue to practice, and I will let you know how its goes…in mean time I will attach my result :grin: :grin: :grin:

Here it is the link:
https://drive.google.com/drive/folders/16LWl010sHUZgic2-ZzKvx96f2FziYIcy?usp=sharing

Thanks again to all of you!