guiwitz / MorphoDynamics

A Python package for tracking the deformation of biological cells.
https://guiwitz.github.io/MorphoDynamics/mydocs/Introduction.html
BSD 3-Clause "New" or "Revised" License
6 stars 3 forks source link

NameError: name 'self' is not defined when loading segmentation #21

Closed mheydasch closed 2 years ago

mheydasch commented 3 years ago

When I try to load a previous segmentation done with the Morpho_segmentation notebook I do get the following error:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
~\miniconda3\envs\morphodynamics\lib\site-packages\morphodynamics\morpho_segmentation.py in load_data(self, b)
    542 
    543         self.param, self.res, self.data = utils.load_alldata(
--> 544             folder_load, load_results=True
    545         )
    546         self.param.bad_frames = utils.format_bad_frames(self.param.bad_frames)

~\miniconda3\envs\morphodynamics\lib\site-packages\morphodynamics\utils.py in load_alldata(folder_path, load_results, param)
     70         data = MultipageTIFF(
     71             Path(param.data_folder),
---> 72             morpho_name=self.param.morpho_name,
     73             signal_name=self.param.signal_name,
     74             data_type=param.data_type,

NameError: name 'self' is not defined

This is the case for both, loading an existing analysis with the Morpho_segmentation notebook, as well as trying to load the analysis with the InterfaceFigureTabs notebook.

guiwitz commented 3 years ago

This should be fixed but I didn't have time to properly test, so please let me know if it works now. You can update following these instructions https://github.com/guiwitz/MorphoDynamics#updates.

mheydasch commented 3 years ago

I am now left with the error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
~\miniconda3\envs\morphodynamics\lib\site-packages\morphodynamics\plots\ui_outputs.py in load_data(self, b)
     71             display(self.wimage.interface)
     72         self.wimage.show_segmentation()
---> 73         self.create_ui()
     74 
     75         self.batch = BatchExport(self.param, self.data, self.res)

~\miniconda3\envs\morphodynamics\lib\site-packages\morphodynamics\plots\ui_outputs.py in create_ui(self)
    137 
    138         self.c = Correlation(self.param, self.data, self.res)
--> 139         self.c.create_interface()
    140         self.outputs.append(self.c.interface)
    141         self.names.append("Correlation")

~\miniconda3\envs\morphodynamics\lib\site-packages\morphodynamics\plots\ui_correlation.py in create_interface(self)
     32 
     33         options = ["displacement", "cumulative displacement"]
---> 34         for m in range(len(self.data.signalfile)):
     35             options.append(self.data.get_channel_name(m))
     36 

AttributeError: 'MultipageTIFF' object has no attribute 'signalfile'

and no further options for figures appear, while a dataless Curvature.pdf graph is saved.

guiwitz commented 3 years ago

Ok I fixed this now. But it's highly probable thats other things won't work as in recent times we rather focused on the processing part than on the plotting part with Kobus. If you encounter further problems, please create an example dataset and share it with me.

mheydasch commented 3 years ago

Thanks, this is working now. However, there still is no option to safe the data about edge displacement and curvature, except for the unlabeled and therefore extremely hard to interpret correlation file.