-
Notifications
You must be signed in to change notification settings - Fork 1
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
Automatically install missing packages #43
Conversation
…onSelectVolumesFolderButton() method
segm_data = segm.get_fdata() | ||
segm_data_dtype = segm.dataobj.dtype | ||
print(f'infile: {input_path}, dtype: {segm_data.dtype}') | ||
if segm_data.dtype != np.uint8: | ||
if segm_data_dtype != np.uint8: | ||
segm_data = segm_data.astype(np.uint8) | ||
segm_nii = nib.Nifti1Image(segm_data, segm.affine) | ||
segm.header.set_data_dtype(np.uint8) | ||
segm_nii = nib.Nifti1Image(segm_data, segm.affine, segm.header) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes seem unrelated to package management. For the sake of clarity in the git history, should we do avoid unrelated changes in this PR, and address these changes in another, more specific, PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sorry, I should have created another issue and PR specific to this, a small bug I found while testing the module. Note: .get_fdata()
returns a floating point image so if segm_data.dtype != np.uint8:
would always have returned False
.
modality: 'MRI' # 'CT' or 'MRI' | ||
modality: 'CT' # 'CT' or 'MRI' | ||
slice_view_color: 'Red' # 'Red' or 'Yellow' or 'Green' | ||
|
||
interpolate_value: 0 | ||
interpolate_value: 1 | ||
|
||
impose_bids_format: True | ||
impose_bids_format: False | ||
|
||
is_classification_requested: True | ||
is_segmentation_requested: True | ||
is_semi_automatic_phe_tool_requested: True | ||
|
||
ct_window_width: 85 | ||
ct_window_level: 45 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also unrelated to package management
Tested on fresh Slicer install, and issue related to the missing qt import: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Applications/Slicer.app/Contents/lib/Python/lib/python3.9/imp.py", line 169, in load_source
module = _exec(spec, sys.modules[name])
File "<frozen importlib._bootstrap>", line 613, in _exec
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/Users/julien/code/slicer-manual-annotation/SlicerCART/src/SlicerCART.py", line 67, in <module>
check_and_install_python_packages()
File "/Users/julien/code/slicer-manual-annotation/SlicerCART/src/SlicerCART.py", line 52, in check_and_install_python_packages
response = qt.QMessageBox.question(slicer.util.mainWindow(), 'Install Extensions', msg,
NameError: name 'qt' is not defined
[Qt] loadSourceAsModule - Failed to load file "/Users/julien/code/slicer-manual-annotation/SlicerCART/src/SlicerCART.py" as module "SlicerCART" !
[Qt] Fail to instantiate module "SlicerCART"
[Qt] The following modules failed to be instantiated:
[Qt] SlicerCART
[Qt] Populating font family aliases took 106 ms. Replace uses of missing font family ".AppleSystemUIFont" with one that exists to avoid this cost. Although |
This is a branch off of #41
TODO:
TODO in subsequent PRs: