Open BartholomaeusAstrum opened 4 years ago
Trying to run on a different directory generates a different error:
dhcp-130-58-75-101:UltraTrace nstern1$ python3 -m ultratrace /Volumes/ResearchAssistant/ultrasound/processed.git/P03
INFO: initializing UltraTrace
INFO: - initializing module: Data
DEBUG: - parsing directory: `/Volumes/ResearchAssistant/ultrasound/processed.git/P03`
DEBUG: - found metadata file: `/Volumes/ResearchAssistant/ultrasound/processed.git/P03/metadata.json`
INFO: - initializing module: Control
INFO: - initializing module: Trace
INFO: - initializing module: Dicom
Traceback (most recent call last):
File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/nstern1/Desktop/UltraTrace/ultratrace/__main__.py", line 604, in <module>
app = App()
File "/Users/nstern1/Desktop/UltraTrace/ultratrace/__main__.py", line 78, in __init__
self.Dicom = modules.Dicom(self)
File "/Users/nstern1/Desktop/UltraTrace/ultratrace/modules/dicom.py", line 47, in __init__
self.reset()
File "/Users/nstern1/Desktop/UltraTrace/ultratrace/modules/dicom.py", line 148, in reset
self.methodMenu = OptionMenu(self.frame, self.method, *[x.label for x in READERS[self.mode]], command=self.chooseMethod)
TypeError: __init__() missing 1 required positional argument: 'value'
Regarding the first error, it looks like TextGrid::makeFrameWidget
was never called, although it's hard to see exactly why without your dataset. You can try to debug that yourself by applying this patch to enter the python debugger when you encounter that error:
PATCH-debug-missing-frames-canvas.txt
$ # download the file, then navigate to the repo and run
$ git apply /path/to/PATCH-debug-missing-frames-canvas.txt
Regarding the second error, that will happen if READERS[self.mode]
is an iterable of len() == 0
. This is probably because you're in an unrecognized self.mode
? Again, difficult to debug without the actual data, but you can try entering the debugger as above :^)
Finally, you can put your stack traces in monospace by putting a line containing ```
(i.e., triple backtick) directly above and below them :^)
I believe this is an issue @mr-martian identified this morning.
@BartholomaeusAstrum, try checking out an earlier commit (git checkout commithash
) to get around it until a fix is found.
Yeah, I pushed some incomplete changes last night, so probably just stick with 4c54f9d02a74404e6be71d2815abe6d159ea9f64 and I'll finish the file processing stuff in the next few days hopefully.
For the second error, I forgot check what happens if there is neither a dicom nor a ult found.
Should be fixed as of 8d7c172.
The issue was ultimately that the textgrid module was calling Metadata.unrelativize
multiple times on the same path and thus erroring due to trying to open a non-existent textgrid file.
"Extract to PNGs" does not correctly load pre-existing PNGs. Script tries to load from /Volumes/ResearchAssistant/ultrasound/processed.git/P04/dicom/048_dicom_to_png/048_frame_0001.png
whereas the files are at /Volumes/ResearchAssistant/ultrasound/processed.git/P04/048_dicom_to_png/048_frame_0001.png
Full trace:
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 1705, in __call__
return self.func(*args)
File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 3442, in __call__
self.__callback(self.__value, *args)
File "/Users/nstern1/Desktop/UltraTrace/ultratrace/modules/dicom.py", line 94, in chooseMethod
self.update()
File "/Users/nstern1/Desktop/UltraTrace/ultratrace/modules/dicom.py", line 69, in update
self.zframe.setImage(self.reader.getFrame(_frame or self.app.frame))
File "/Users/nstern1/Desktop/UltraTrace/ultratrace/util/framereader.py", line 147, in getFrame
return Image.open(self.png_name % framenum)
File "/usr/local/lib/python3.7/site-packages/PIL/Image.py", line 2652, in open
fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '/Volumes/ResearchAssistant/ultrasound/processed.git/P04/dicom/048_dicom_to_png/048_frame_0001.png'
Also received another error when I tried loading a file with already-generated PNGs:
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 1705, in __call__
return self.func(*args)
File "/Users/nstern1/Desktop/UltraTrace/ultratrace/modules/dicom.py", line 77, in load
self.reader.load()
File "/Users/nstern1/Desktop/UltraTrace/ultratrace/util/framereader.py", line 121, in load
info( 'Reading DICOM data ...', end='\r' )
TypeError: info() got an unexpected keyword argument 'end'
That second one is my fault. I'll submit a patch shortly. Sorry about that!
Should be fixed in 5d5c410, @BartholomaeusAstrum can you verify?
@BartholomaeusAstrum does 69829bb fix the png location issue?
PNG location issue is fixed!
Now the program can't create new PNGs. It seems like it's looking for pre-existing ones instead. My attempt to generate PNGs for slide 058 (by selecting "Extract to PNGs") generated the following error:
INFO: /Volumes/ResearchAssistant/ultrasound/processed.git/P04/dicom/058_dicom_to_png
ERROR: file /Volumes/ResearchAssistant/ultrasound/processed.git/P04/dicom/058_dicom_to_png/058_frame_0001.png does not exist
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 1705, in __call__
return self.func(*args)
File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 3442, in __call__
self.__callback(self.__value, *args)
File "/Users/nstern1/Desktop/UltraTrace/ultratrace/modules/dicom.py", line 106, in chooseMethod
self.update()
File "/Users/nstern1/Desktop/UltraTrace/ultratrace/modules/dicom.py", line 69, in update
self.zframe.setImage(self.reader.getFrame(_frame or self.app.frame))
File "/Users/nstern1/Desktop/UltraTrace/ultratrace/widgets/zoom_frame.py", line 88, in setImage
self.width, self.height = self.image.size
AttributeError: 'NoneType' object has no attribute 'size'
I also just noticed the following error generated on startup: may be unrelated.
INFO: - initializing module: Control
INFO: - initializing module: Trace
INFO: - initializing module: Dicom
INFO: - initializing module: Audio
INFO: - initializing module: Video
INFO: - initializing module: TextGrid
ERROR: '_tkinter.tkapp' object has no attribute 'Spectrogram'
INFO: - initializing module: Spectrogram
INFO: - loading widgets
"Read pixel data" seems to still work
Here's what I tried to do, and the error I got: