JingyiGF / HERBS

MIT License
18 stars 15 forks source link

Error in probe info #30

Closed mwawra closed 1 year ago

mwawra commented 1 year ago

Sorry, but I have found another problem. When I want to view the probe info of a probe with at least 2 pieces on different atlas-overlays I get the following error:

something went wrong, 
Traceback (most recent call last):
  File "C:\Users\Matthias\Documents\Neurophys-INSERM\herbs_git\herbs\object_control.py", line 930, in info_btn_clicked
    self.obj_info_on_click()
  File "C:\Users\Matthias\Documents\Neurophys-INSERM\herbs_git\herbs\object_control.py", line 940, in obj_info_on_click
    self.info_window = ProbeInfoWindow(da_name, da_data)
  File "C:\Users\Matthias\Documents\Neurophys-INSERM\herbs_git\herbs\object_control.py", line 425, in __init__
    sites_u_color.append(group_region_color[temp[0]])
IndexError: index 0 is out of bounds for axis 0 with size 0

I'm quite sure that this worked in the old pip version. Unfortunately, I can't test this specific project there due to incompatibilities between the versions in pip and on github.

JingyiGF commented 1 year ago

Thanks for finding this. Before there were only NP 1.0 and NP 2.0 in HERBS, the plotting in the info window was only count for the sites. The sites for NP 1.0 and 2.0 are so close to each other, so I just use the sites label to draw the probe. But this is not the case if the sites are so far from each other (there is a request for other linear silicon probes). So to make the code generic for both cases, a fine grids for labels along the probe is created to plot probe and sites labels for plot sites. If the grids are not fine enough, there might be problem that the probe labels could not cover all sites labels. That is the error reported. Now the code updated on GitHub. did not test for all possible cases. Need to work on this.

mwawra commented 1 year ago

Hey, coming back to this. With the latest version on git I don't get this error anymore, but somehow the anatomical regions are odd. I have one data set where the probe has two pieces. With the old version (pip) of the program the tip of the probe is in the ventral hippocampus, but with the latest version from git HERBS tells me some part of the tip is in the corpus callosum, which makes no sense. When I unmerge the two pieces and make two probes out of them the regions are much more correct.

JingyiGF commented 1 year ago

Hi, I found the new code for calculating the probe info has some problem also, and I am trying to fix it now, but very slow. I am still one week ok, one week sick. It is a ridiculous time of the year for families who has small kids. My kiddo get sick every other week and so do I. Sorry for the inconvenience, will fix it this week.

mwawra commented 1 year ago

Hi, don't worry, kids are definitely a higher priority! :)

JingyiGF commented 1 year ago

Hi Matthias, I finallllllly fixed the bugs and uploaded the code to GitHub and PyPI. Let me know if there is anything wrong or not clear. Or any idea to change anything. you are always welcome to modify anything.

Thank you so much for all your help in 2022. Wish you a happy holiday season and see you in 2023!

mwawra commented 1 year ago

Hello, thanks for the fix. Now the assignment of the anatomical regions is much better.

Thank you for the nice support and see you in 2023! Happy holidays!