Skip to content

Error when opening project after cell counting #71

Description

@clarunger

Hi!
We are using brainways on a Windows 11 (CPU).
We are facing problems after cell detection. After completion of cell detection, the program crashed and when trying to open the project again, gave this error message:


JSONDecodeError Traceback (most recent call last)
File ~\AppData\Local\miniforge3\envs\brnws\lib\site-packages\superqt\utils_qthreading.py:613, in create_worker..reraise(e=JSONDecodeError('Expecting value: line 1 column 1 (char 0)'))
612 def reraise(e):
--> 613 raise e
e = JSONDecodeError('Expecting value: line 1 column 1 (char 0)')

File ~\AppData\Local\miniforge3\envs\brnws\lib\site-packages\superqt\utils_qthreading.py:175, in WorkerBase.run(self=<napari._qt.qthreading.GeneratorWorker object>)
173 warnings.filterwarnings("always")
174 warnings.showwarning = lambda *w: self.warned.emit(w)
--> 175 result = self.work()
self = <napari._qt.qthreading.GeneratorWorker object at 0x000002A580954EE0>
176 if isinstance(result, Exception):
177 if isinstance(result, RuntimeError):
178 # The Worker object has likely been deleted.
179 # A deleted wrapped C/C++ object may result in a runtime
180 # error that will cause segfault if we try to do much other
181 # than simply notify the user.

File ~\AppData\Local\miniforge3\envs\brnws\lib\site-packages\superqt\utils_qthreading.py:440, in GeneratorWorker.work(self=<napari._qt.qthreading.GeneratorWorker object>)
438 try:
439 _input = self._next_value()
--> 440 output = self._gen.send(_input)
self = <napari._qt.qthreading.GeneratorWorker object at 0x000002A580954EE0>
_input = None
output = 'Opening project...'
self._gen = <generator object BrainwaysUI._open_project at 0x000002A58087B7D0>
441 self.yielded.emit(output)
442 except StopIteration as exc:

File ~\AppData\Local\miniforge3\envs\brnws\lib\site-packages\brainways\ui\brainways_ui.py:218, in BrainwaysUI._open_project(self=<brainways.ui.brainways_ui.BrainwaysUI object>, path=WindowsPath('S:/Lab_Member/Foteini/Imaging/BRAINWAYS/ER_expression_age_differences.bwp'))
216 def _open_project(self, path: Path):
217 yield "Opening project..."
--> 218 self._project = BrainwaysProject.open(path, lazy_init=True)
self._project = None
self = <brainways.ui.brainways_ui.BrainwaysUI object at 0x000002A55A9E9900>
path = WindowsPath('S:/Lab_Member/Foteini/Imaging/BRAINWAYS/ER_expression_age_differences.bwp')
219 # subjects with no valid documents are not supported in GUI
220 self.project.subjects = [
221 subject
222 for subject in self.project.subjects
223 if len(subject.valid_documents) > 0
224 ]

File ~\AppData\Local\miniforge3\envs\brnws\lib\site-packages\brainways\project\brainways_project.py:127, in BrainwaysProject.open(cls=<class 'brainways.project.brainways_project.BrainwaysProject'>, path=WindowsPath('S:/Lab_Member/Foteini/Imaging/BRAINWAYS/ER_expression_age_differences.bwp'), lazy_init=True)
121 subject_directories = [
122 d.parent for d in path.parent.rglob("*.bws") if d.is_file()
123 ]
124 subject_directories = natsorted(
125 subject_directories, alg=ns.IGNORECASE, key=lambda x: x.name
126 )
--> 127 subjects = [
project = <brainways.project.brainways_project.BrainwaysProject object at 0x000002A5808F2C50>
subject_directories = [WindowsPath('S:/Lab_Member/Foteini/Imaging/BRAINWAYS/2235'), WindowsPath('S:/Lab_Member/Foteini/Imaging/BRAINWAYS/2235_VTA'), WindowsPath('S:/Lab_Member/Foteini/Imaging/BRAINWAYS/002236'), WindowsPath('S:/Lab_Member/Foteini/Imaging/BRAINWAYS/2238'), WindowsPath('S:/Lab_Member/Foteini/Imaging/BRAINWAYS/mouse1'), WindowsPath('S:/Lab_Member/Foteini/Imaging/BRAINWAYS/mouse2'), WindowsPath('S:/Lab_Member/Foteini/Imaging/BRAINWAYS/mouse_3')]
128 BrainwaysSubject.open(path=subject_path / "data.bws", project=project)
129 for subject_path in subject_directories
130 ]
131 project.subjects = subjects
132 return project

File ~\AppData\Local\miniforge3\envs\brnws\lib\site-packages\brainways\project\brainways_project.py:128, in (.0=<list_iterator object>)
121 subject_directories = [
122 d.parent for d in path.parent.rglob("*.bws") if d.is_file()
123 ]
124 subject_directories = natsorted(
125 subject_directories, alg=ns.IGNORECASE, key=lambda x: x.name
126 )
127 subjects = [
--> 128 BrainwaysSubject.open(path=subject_path / "data.bws", project=project)
project = <brainways.project.brainways_project.BrainwaysProject object at 0x000002A5808F2C50>
subject_path = WindowsPath('S:/Lab_Member/Foteini/Imaging/BRAINWAYS/mouse2')
129 for subject_path in subject_directories
130 ]
131 project.subjects = subjects
132 return project

File ~\AppData\Local\miniforge3\envs\brnws\lib\site-packages\brainways\project\brainways_subject.py:82, in BrainwaysSubject.open(cls=<class 'brainways.project.brainways_subject.BrainwaysSubject'>, path=WindowsPath('S:/Lab_Member/Foteini/Imaging/BRAINWAYS/mouse2/data.bws'), project=<brainways.project.brainways_project.BrainwaysProject object>)
79 raise FileNotFoundError(f"Subject file not found: {path}")
81 with open(path) as f:
---> 82 serialized_file = json.load(f)
f = <_io.TextIOWrapper name='S:\Lab_Member\Foteini\Imaging\BRAINWAYS\mouse2\data.bws' mode='r' encoding='cp1252'>
84 subject_file = dacite.from_dict(
85 SubjectFileFormat, serialized_file, config=dacite.Config(cast=[tuple])
86 )
87 subject = BrainwaysSubject(
88 subject_info=subject_file.subject_info,
89 slice_infos=subject_file.slice_infos,
90 project=project,
91 )

File ~\AppData\Local\miniforge3\envs\brnws\lib\json_init_.py:293, in load(fp=<_io.TextIOWrapper name='S:\Lab_Member\Foteini...YS\mouse2\data.bws' mode='r' encoding='cp1252'>, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw={})
274 def load(fp, *, cls=None, object_hook=None, parse_float=None,
275 parse_int=None, parse_constant=None, object_pairs_hook=None, **kw):
276 """Deserialize fp (a .read()-supporting file-like object containing
277 a JSON document) to a Python object.
278
(...)
291 kwarg; otherwise JSONDecoder is used.
292 """
--> 293 return loads(fp.read(),
fp = <_io.TextIOWrapper name='S:\Lab_Member\Foteini\Imaging\BRAINWAYS\mouse2\data.bws' mode='r' encoding='cp1252'>
cls = None
object_hook = None
parse_float = None
parse_int = None
parse_constant = None
object_pairs_hook = None
kw = {}
294 cls=cls, object_hook=object_hook,
295 parse_float=parse_float, parse_int=parse_int,
296 parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)

File ~\AppData\Local\miniforge3\envs\brnws\lib\json_init_.py:346, in loads(s='', cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw={})
341 s = s.decode(detect_encoding(s), 'surrogatepass')
343 if (cls is None and object_hook is None and
344 parse_int is None and parse_float is None and
345 parse_constant is None and object_pairs_hook is None and not kw):
--> 346 return _default_decoder.decode(s)
s = ''
_default_decoder = <json.decoder.JSONDecoder object at 0x000002A5623AFC40>
347 if cls is None:
348 cls = JSONDecoder

File ~\AppData\Local\miniforge3\envs\brnws\lib\json\decoder.py:337, in JSONDecoder.decode(self=<json.decoder.JSONDecoder object>, s='', _w=)
332 def decode(self, s, _w=WHITESPACE.match):
333 """Return the Python representation of s (a str instance
334 containing a JSON document).
335
336 """
--> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
s = ''
self = <json.decoder.JSONDecoder object at 0x000002A5623AFC40>
_w = <built-in method match of re.Pattern object at 0x000002A5622F53C0>
338 end = _w(s, end).end()
339 if end != len(s):

File ~\AppData\Local\miniforge3\envs\brnws\lib\json\decoder.py:355, in JSONDecoder.raw_decode(self=<json.decoder.JSONDecoder object>, s='', idx=0)
353 obj, end = self.scan_once(s, idx)
354 except StopIteration as err:
--> 355 raise JSONDecodeError("Expecting value", s, err.value) from None
s = ''
356 return obj, end

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions