Checklist
Describe the bug
I encountered a badly processed grain in minicircle.spm from a bad config, where a skeleton is not produced.
This resulted in a crash when trying to print(grain_crop).
Copy of the log-file from running with topostats --log-level debug <command>
<class 'NoneType'>
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[24], [line 31](vscode-notebook-cell:?execution_count=24&line=31)
29 skeleton = grain_crop.skeleton
30 print(type(skeleton))
---> [31](vscode-notebook-cell:?execution_count=24&line=31) print(f"Grain {grain_index}: {grain_crop}")
File ~/src/TopoStats/topostats/classes.py:186, in GrainCrop.__str__(self)
174 def __str__(self) -> str:
175 """
176 Representation function for useful statistics for the class.
177
(...)
181 Set of formatted statistics on matched branches.
182 """
183 return (
184 f"filename : {self.filename}\n"
185 f"image shape : {self.image.shape}\n"
--> [186](https://file+.vscode-resource.vscode-cdn.net/Users/sylvi/src/TopoStats/dev-scripts/__marimo__/session/~/src/TopoStats/topostats/classes.py:186) f"skeleton shape : {self.skeleton.shape}\n"
187 f"mask shape : {self.mask.shape}\n"
188 f"padding : {self.padding}\n"
189 f"thresholds : {self.thresholds}\n"
190 f"threshold method : {self.threshold_method}\n"
191 f"threshold index : {self.threshold_idx}\n"
192 f"bounding box coords : {self.bbox}\n"
193 f"pixel to nm scaling : {self.pixel_to_nm_scaling}\n"
194 f"number of nodes : {len(self.nodes)}"
195 )
AttributeError: 'NoneType' object has no attribute 'shape'
Include the configuration file
N/A
To Reproduce
No response
TopoStats Version
Git main branch
Python Version
3.11
Operating System
MacOS M1/M2 (post-2021)
Python Packages
No response
Checklist
mainbranch to check if the issue persists. Instructions on how to do this can be found here.topostats --core 1 process.topostats --log-level debug <command>.topostats --versionDescribe the bug
I encountered a badly processed grain in minicircle.spm from a bad config, where a skeleton is not produced.
This resulted in a crash when trying to
print(grain_crop).Copy of the log-file from running with
topostats --log-level debug <command>Include the configuration file
N/A
To Reproduce
No response
TopoStats Version
Git main branch
Python Version
3.11
Operating System
MacOS M1/M2 (post-2021)
Python Packages
No response