Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

confusion about coordinates #43

Open
chongtianyifa opened this issue Apr 14, 2023 · 9 comments
Open

confusion about coordinates #43

chongtianyifa opened this issue Apr 14, 2023 · 9 comments

Comments

@chongtianyifa
Copy link

chongtianyifa commented Apr 14, 2023

Hi Jingyi,
probe 1.zip

I am quite confused about the coordinate unit of data points saved in each probe.pkl. I attached one pkl file.
I did some dig in, and I want to know whether my understanding is correct.

  1. Variables like ''insertion_vox'', their unit is voxel (zero point is at left, bottom, and back of the volume). Variables like ''insertion_coords'', their unit is um, relative to bregma. Other variables, like 'data' of clicked points along the trajectory track, their unit is voxel relative to bregma.
  2. Now I want to get the coordinates of clicked points in the unit of voxel (I want to transfer them to ccf coordinates later). I need to know the coordinate of the bregma in the voxel unit. When I load the atlas, the command window display this:
    image
    However, I found this was not correct. Instead, I estimated as follows (my atlas resolution is 25 um):
    res = 25
    with open(herbs_output, 'rb') as f:
    data = pickle.load(f)
    insertion_vox = data['data']['insertion_vox'] # ML, AP, DV from herbs as in RAS orientation
    insertion_coords = data['data']['insertion_coords']
    bregma_vox = (insertion_vox -insertion_coords/res)

This gives me bregma (227, 310, 300).
Finally, I got the vox coordination of clicked points:
data_clicked = np.concatenate(data['data']['data'], axis=0) # relative to bregma, vox unit
data_clicked = data_clicked + bregma_vox

Please let me know if my understanding/calculation is correct.

Thank you,
Chris

@chongtianyifa chongtianyifa changed the title confusion about coordinate confusion about coordinates Apr 14, 2023
@JingyiGF
Copy link
Owner

Hi, Sorry for the super late reply. I was trying to finish a tutorial on this then reply you. But there was another deadline came so that I have to finish that first. I will finish the tutorial on this next week and update you then.

Sorry again for not replying you earlier! But I do care about every thread on issues on HERBS. And thank you for your patience :-)

@chongtianyifa
Copy link
Author

Hi, no problem. I am looking forward to your answer.

@chongtianyifa
Copy link
Author

Hi,

I have a following question. How do you initialize the location of first channel? Is it the point in the fitted center line closest to the deepest one among clicked points? Where are the coordinates of each channel stored? I found that sites_label/sites_loc_b/sites_vox contains 4 lists, each is 104*3 array. Since NP 1.0 have 384 channel, I have no idea how to find the coordinate of each channel.

Thank you in advance

@JingyiGF
Copy link
Owner

Hi, sorry for the late reply. I have no time to have a look at the following questions, but I write a short tutorial on the atlas coordinates and bregma. Please see the corresponding tutorial https://github.com/JingyiGF/HERBS/blob/main/Tutorial/Atlas_Related/about_atlas_through_herbs.md

@JingyiGF
Copy link
Owner

Hi,

I have a following question. How do you initialize the location of first channel? Is it the point in the fitted center line closest to the deepest one among clicked points? Where are the coordinates of each channel stored? I found that sites_label/sites_loc_b/sites_vox contains 4 lists, each is 104*3 array. Since NP 1.0 have 384 channel, I have no idea how to find the coordinate of each channel.

Thank you in advance

Hi, about this question, please first read https://github.com/JingyiGF/HERBS/blob/main/Tutorial/Probe_Related/4-Design_Linear_Silicon_Probe.md

NP1.0 has a strict configuration. The line you clicked is the middle line, and 4 columns of sites are constructed according to the face direction you choose. from the info you gave "104*3", the 3 indicates (x, y, z) coordinate values. 104 should be the number of possible sites on each column. Please contact me again if I am not clear with this quick answer.

@chongtianyifa
Copy link
Author

Hi, thank you for the answers. I am still not sure how the coordinate of the deepest channel (channel 1) was estimated. Is it the projection of the deepest point on the fitted center line? Or did you adjust the depth since there was ~200um between the tip and channel in for NP1.0?

@JingyiGF
Copy link
Owner

HI, Please see the screenshot.

Inkednp1

Assume the red dots are the points you clicked on the brain slice. HERBS maps the deepest point onto the tip and find the top point according to the distance between the 2 red dots traveled inside the brain. And then the sites are calculated according to the configuration of the probe. HERBS allows 4 facing options. Please see Tutorial Important things you need to know before you start https://github.com/JingyiGF/HERBS/blob/main/Tutorial/Probe_Related/1-Important_to_know_before_you_start.md

Let me know if anything is not clear. I am still suffering from a bad cold so perhaps not so clear brain right now.

@chongtianyifa
Copy link
Author

Hi, did you mean the distance between the bottom and top points I clicked finally matched the tip of the probe and the top recording channel? What if 384 channels were used while the distance between the bottom and top clicked points was less than the physical distance between the tip of the probe and channel 384?

@JingyiGF
Copy link
Owner

HI, no. The bottom point you clicked matched to the tip, but top matched to the location according to the distance between 2 points if the distance is shorter than the probe length. If the distance is longer than the probe length, then the distance will be adjusted to the probe length by moving the bottom point up along the trajectory until the distance is the same as the probe length.

If 384 channels were used (if you mean you have signals on all 384 channels) and the distance between 2 clicked points are shorter than the physical distance, then I would suggest you re-do the registration work. If you mean you did not put all 384 channels part inside the brain, HERBS will calculation the possible channels locations inside the brain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants