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

Notebooks currently non functional #14

Open
NicoKiaru opened this issue Apr 2, 2024 · 6 comments
Open

Notebooks currently non functional #14

NicoKiaru opened this issue Apr 2, 2024 · 6 comments

Comments

@NicoKiaru
Copy link
Member

I get this error in the first example notebook:

4. DeepSlice Registration(s)[¶](http://localhost:8888/lab/workspaces/auto-C/tree/Dropbox/BIOP/abba_python/example_notebooks/0.%20Register%20And%20Save%20State.ipynb#4.-DeepSlice-Registration(s))

# a first deepslice registration round : possible because it's the Allen CCF atlas, cut in coronal mode

# what's assumed : the sections are already in the correct order

aligner.register_slices_deepslice_local(channels=[0, 1],

                                  ensemble=False,

                                  model='mouse',

                                  post_processing='Keep order + ensure regular spacing',

                                  slices_spacing_micrometer=-1,      

                                  allow_slicing_angle_change=True) # use run_mode='Web' if you are not headless and without a local deepslice env

​

#allow_slicing_angle_change: bool,

#                                        channels: str,

#                                        ensemble: bool,

#                                        model: str,

#                                        post_processing: str,

#                                        slices_spacing_micrometer: float

​

# second deepslice registration: because the slices are resampled for the registration,

# we usually get a slightly better positioning along z and cutting angle

# also: it's fast, and the combination of two affine transforms is

# an affine transform, so it's not like we are adding extra degrees of freedom

# aligner.register_slices_deepslice(channels=[0, 1],

#                                  maintain_slices_order = True, # the slices are already sorted: do not mess the order

#                                  run_mode='local') # use run_mode='web' if you are not headless and without a local deepslice env

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[13], line 3
      1 # a first deepslice registration round : possible because it's the Allen CCF atlas, cut in coronal mode
      2 # what's assumed : the sections are already in the correct order
----> 3 aligner.register_slices_deepslice_local(channels=[0, 1],
      4                                   ensemble=False,
      5                                   model='mouse',
      6                                   post_processing='Keep order + ensure regular spacing',
      7                                   slices_spacing_micrometer=-1,      
      8                                   allow_slicing_angle_change=True) # use run_mode='Web' if you are not headless and without a local deepslice env
     10 #allow_slicing_angle_change: bool,
     11 #                                        channels: str,
     12 #                                        ensemble: bool,
   (...)
     22 #                                  maintain_slices_order = True, # the slices are already sorted: do not mess the order
     23 #                                  run_mode='local') # use run_mode='web' if you are not headless and without a local deepslice env

File ~\AppData\Local\abba-python-0.8.0\lib\site-packages\abba_python\abba.py:834, in Abba.register_slices_deepslice_local(self, allow_slicing_angle_change, channels, ensemble, model, post_processing, slices_spacing_micrometer)
    821 """
    822 Uses Deepslice for affine in plane and axial registration of selected slices
    823 
   (...)
    830 slices_spacing_micrometer (float): Spacing (micrometer), used only when 'Keep order + set spacing' is selected
    831 """
    832 RegisterSlicesDeepSliceLocalCommand = jimport(
    833     'ch.epfl.biop.atlas.aligner.command.RegisterSlicesDeepSliceLocalCommand')
--> 834 return self.ij.command().run(RegisterSlicesDeepSliceLocalCommand, True,
    835                              'mp', self.mp,
    836                              'allow_slicing_angle_change', allow_slicing_angle_change,
    837                              'channels', channels,
    838                              'ensemble', ensemble,
    839                              'model', model,
    840                              'post_processing', post_processing,
    841                              'slices_spacing_micrometer', slices_spacing_micrometer).get()

TypeError: No matching overloads found for org.scijava.command.DefaultCommandService.run(_jpype._JClass,bool,str,ch.epfl.biop.atlas.aligner.MultiSlicePositioner,str,bool,str,list,str,bool,str,str,str,str,str,int), options are:
	public java.util.concurrent.Future org.scijava.command.DefaultCommandService.run(java.lang.String,boolean,java.util.Map)
	public java.util.concurrent.Future org.scijava.command.DefaultCommandService.run(org.scijava.command.CommandInfo,boolean,java.util.Map)
	public java.util.concurrent.Future org.scijava.command.DefaultCommandService.run(org.scijava.command.CommandInfo,boolean,java.lang.Object[])
	public java.util.concurrent.Future org.scijava.command.DefaultCommandService.run(java.lang.Class,boolean,java.util.Map)
	public java.util.concurrent.Future org.scijava.command.DefaultCommandService.run(java.lang.String,boolean,java.lang.Object[])
	public java.util.concurrent.Future org.scijava.command.DefaultCommandService.run(java.lang.Class,boolean,java.lang.Object[])
@NicoKiaru
Copy link
Member Author

It's because of the channels taht are lists...

@NicoKiaru
Copy link
Member Author

Another error in notebook 2:


ModuleNotFoundError Traceback (most recent call last)
Cell In[5], line 6
1 # -- FOR DEBUGGING
2 # import imagej.doctor
3 # imagej.doctor.checkup()
4 # imagej.doctor.debug_to_stderr()
----> 6 aligner = Abba('azba_zfish_4um') # Simply put the name of the BrainGlobe atlas
7 aligner.show_bdv_ui() # creates and show a bdv view
9 # !! Warning : it takes time... first : downloading the atlas if not present
10 # it can take up to a minute...

@NicoKiaru
Copy link
Member Author

File ~\AppData\Local\abba-python-0.8.0\lib\site-packages\abba_python\abba.py:181, in Abba.init(self, atlas_name, ij, slicing_mode, headless, print_config)
179 bg_atlas = BrainGlobeAtlas(atlas_name)
180 # initialized
--> 181 from abba_private import abba_atlas
182 atlas = abba_atlas.AbbaAtlas(bg_atlas, ij)
183 atlas.initialize(None, None)

ModuleNotFoundError: No module named 'abba_private'

@NicoKiaru
Copy link
Member Author

Notebook 4: mettre a jour la commande deepslice

@GuillaumeLeGoc
Copy link
Contributor

Another error in notebook 2:

ModuleNotFoundError Traceback (most recent call last) Cell In[5], line 6 1 # -- FOR DEBUGGING 2 # import imagej.doctor 3 # imagej.doctor.checkup() 4 # imagej.doctor.debug_to_stderr() ----> 6 aligner = Abba('azba_zfish_4um') # Simply put the name of the BrainGlobe atlas 7 aligner.show_bdv_ui() # creates and show a bdv view 9 # !! Warning : it takes time... first : downloading the atlas if not present 10 # it can take up to a minute...

Hey @NicoKiaru, indeed we can't load Brainglobe atlases anymore, with the error you posted : ModuleNotFoundError: No module named 'abba_private'.
I'm not familiar with Python packages/modules etc. so I don't know why it is not found while the abba_python folder is next to the abba.py module.
But changing this line :

from abba_private import abba_atlas

to

from abba_python.abba_private import abba_atlas

works.

@NicoKiaru
Copy link
Member Author

Thanks!

I'm not familiar with Python packages/modules etc. s

Yeah, me neither 😓 . I'm struggling to get an identical code to work both:

  • for the python packaged module,
  • within an IDE,
  • and with the conda constructor installer

Honestly that's a mess.

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

Successfully merging a pull request may close this issue.

2 participants