-
Notifications
You must be signed in to change notification settings - Fork 11
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
KeyError: 'top_ncc_first' #401
Comments
Hi, thanks @sajiniho07 for your report! Can you send me the full error message and, if possible, the content of |
Also the |
This message is a complete error report that I received. And my input files are all in DCM format. It seems that your library cannot handle the raw DCM file and connect them together. They must be input files in the NPY format. Therefore, I think the code I wrote is incorrect. What do you think? Thank you very much for your attention. 😊 https://github.com/sajiniho07/StitchingTiles/blob/main/m2stitch_method.py 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:05<00:00, 1.46s/it]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<?, ?it/s]
Traceback (most recent call last):
File "d:\AI_sources\my-venv-3-10\lib\site-packages\pandas\core\indexes\base.py", line 3802, in get_loc
return self._engine.get_loc(casted_key)
File "pandas\_libs\index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
File "pandas\_libs\index.pyx", line 165, in pandas._libs.index.IndexEngine.get_loc
File "pandas\_libs\hashtable_class_helper.pxi", line 5745, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas\_libs\hashtable_class_helper.pxi", line 5753, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'top_ncc_first'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\98902\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\98902\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "c:\Users\98902\.vscode\extensions\ms-python.python-2023.14.0\pythonFiles\lib\python\debugpy\__main__.py", line 39, in <module>
cli.main()
File "c:\Users\98902\.vscode\extensions\ms-python.python-2023.14.0\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 430, in main
run()
File "c:\Users\98902\.vscode\extensions\ms-python.python-2023.14.0\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 284, in run_file
runpy.run_path(target, run_name="__main__")
File "c:\Users\98902\.vscode\extensions\ms-python.python-2023.14.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 321, in run_path
return _run_module_code(code, init_globals, run_name,
File "c:\Users\98902\.vscode\extensions\ms-python.python-2023.14.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 135, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "c:\Users\98902\.vscode\extensions\ms-python.python-2023.14.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 124, in _run_code
exec(code, run_globals)
File "D:\AI_sources\projects\stitching\m2stitch_method.py", line 37, in <module>
stitched_result, _ = stitch_images(images=dicom_images, position_indices=position_indices, ncc_threshold=0.3)
File "d:\AI_sources\my-venv-3-10\lib\site-packages\m2stitch\stitching.py", line 200, in stitch_images
grid["top_ncc_first"] > ncc_threshold
File "d:\AI_sources\my-venv-3-10\lib\site-packages\pandas\core\frame.py", line 3807, in __getitem__
indexer = self.columns.get_loc(key)
File "d:\AI_sources\my-venv-3-10\lib\site-packages\pandas\core\indexes\base.py", line 3804, in get_loc
raise KeyError(key) from err
KeyError: 'top_ncc_first' |
Hi, thanks for your udpate!
No, it can be any files, as far as it is read as a numpy array in memory. It seems that the function apply_voi_lut returns np.ndarray, so I wouldn't expect an issue here. I couldn't check your code so carefully, but I think here is where you have a problem.
for a MxN tile. Maybe you can double check this part, or use |
I attempted to run this code, but I encountered a KeyError: 'top_ncc_first' in the
stitch_images
method. What can I do to resolve this error? I'm using Python 3.10.The text was updated successfully, but these errors were encountered: