NHPatterson / regToolboxMSRC

Registration toolbox for microscopy images integrated in imaging mass spectrometry experiments
Apache License 2.0
8 stars 1 forks source link

Documentations #2

Open nrpark opened 4 years ago

nrpark commented 4 years ago

Hello,

Is there any detailed documentation on the GUI? I'm trying to work on a practice dataset (registration of an IMS image to the pixel map, drawing out ROI to extract pixel coordinates) but it seems that the coordinates are not matching the original IMS coordinates that we're pulling out using Cardinal.

Thank you.

NHPatterson commented 4 years ago

Sorry for the lack of documentation... I'm not sure if I will make something full-fledged for this version of the software as a version 2.0 is well on it's way that will be much better and more self-explanatory.

Anyway, I think this info may help:

The pixel mapping first remaps the pixel coordinates to zero-index (or 1-index in R) then pads them a certain number of pixels on all four edges of image (padding set at pixel map generation).

In R, minimizing coordinates

# minimizing xy integer coordinates in R
min_x_coords <- x_coords - min(x_coords) + 1
min_y_coords <- y_coords - min(y_coords) + 1

Padding coordinates

padding = 20 # pad 20 pixels from top-left

pad_x_coords <- min_x_coords + padding
pad_y_coords <- min_y_coords + padding

This padded coordinates should now match the coordinates from the pixel map. If you have the data loaded into Cardinal in the original coordinate space, you can translate between 'mapping key' csv to the pixelmap coordinates.

Let me know how it goes for you

Heath

nrpark commented 4 years ago

Hi Heath,

So we're not providing padding values (we generated outputs using both 0 or 1 as padding and the outputs were the same). On Cardinal, we are extracting coordinates for a particular mz value, then we're trying to compare the coordinates from the ROI that we select on ImageJ from the affine-registered image of the pixel map generated from the GUI (on the leftside of screenshot) and an MSI image of that mz value generated from Cardinal, if that makes sense. image

So we're having an issue matching up these coordinates.

NHPatterson commented 4 years ago

I guess I'm not sure I understand. Maybe could you take me step-by-step what processing you have done for both microscopy and IMS?

Did you:

  1. register your post-acquisition image to the pixel map or
  2. the pixel map to the post-acquistion image.

No. 1 is correct.

It may be easier for me to help if you can share the data in some fashion, even just a ultra simplified version.

Heath

nrpark commented 4 years ago

Sure, so my goal is to extract coordinates of an ROI for a metabolite of interest. I'll list my steps:

1) I've done No. 1 with a Cardinal IMS image output of that metabolite and the pixel map of its imzml file (source: IMS image to target: pixel map). So first I got the pixel map output with these parameters (I tried both 0 and 1 padding and got the same coordinates output): image

2) Then I used ImageJ landmark registration go register the IMS image output from Cardinal onto the pixel map generated (pretty much following this protocol: https://www.protocols.io/view/image-registration-of-maldi-ims-to-microscopy-bed2ja8e.html).

3) Then I drew an ROI on that registered image to extract the coordinates: image

4) And I designate the source image as that landmark-registered image, the pixel map key of the imzml file from step 1), and the ROI zip file from imageJ for 'Set IJ ROIs'.

5) Ultimate goal was to compare the coordinates from this workflow to see if they match the coordinates from Cardinal that I can pull out, given the mz value of that metabolite.

Hopefully this is clearer!

NHPatterson commented 4 years ago

Yes I see. but I think this may be a misunderstanding about the use case of this registration toolbox. All of the registration is based on registering an IMS image to it's corresponding laser ablation mark as measured by microscopy (the post IMS autofluorescence microscopy image). The pixel map is generated from the IMS data so the IMS image doesn't need to be registered to it again as they are using the same data.

The laser ablation mark microscopy image should be aligned to the pixel map. The figure below shows this with some highlights I've added in yellow.

image

Essentially, if you don't have a post IMS microscopy image of the ablation marks, this is not the toolbox to use, as without that image, you can not perform measurably accurate registration. There are other, more general purpose registration tools that I could point you to.

nrpark commented 4 years ago

I see. What is your advice on registration with a microscopy image to IMS pixel map if we do not have the laser ablation marks? The end goal is to still select ROI pixel coordinates with the insight gained from the microscopy images, even if crudely.

nrpark commented 3 years ago

Hello, I'm revisiting this thread to see if I can obtain the original images to work the toolbox to understand the toolbox navigation?