Skip to content

Commit

Permalink
ENH: Improve format of spacing info in ImageTable
Browse files Browse the repository at this point in the history
  • Loading branch information
aylward committed Aug 4, 2024
1 parent 9d64730 commit 107b820
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ itk-wheels
*.mha
*.nii
*.code-workspace
.vscode
4 changes: 2 additions & 2 deletions src/minder3d/lib/sovImageTablePanelWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def remove_selected(self):
@time_and_log
def remove_all(self):
num_images = len(self.state.image_filename)
for row in range(self.imageTableWidget.getRowCount()):
for row in range(self.imageTableWidget.rowCount()):
if row < num_images:
self.gui.unload_image(row, False)
self.settings.remove_data(
Expand Down Expand Up @@ -231,7 +231,7 @@ def redraw_image_row(self, row_num):
f'{i:.4f}' for i in self.state.image[img_num].GetSpacing()
]
self.imageTableWidget.setItem(
row_num, col_num, QTableWidgetItem(','.join(spacing_str))
row_num, col_num, QTableWidgetItem(', '.join(spacing_str))
)
col_num += 1
filename = self.state.image_filename[img_num]
Expand Down
4 changes: 3 additions & 1 deletion src/minder3d/lib/sovImageTableSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ def add_data(
file_size = ''
file_thumbnail = ''
if file_type == 'image':
file_spacing = ','.join([str(s) for s in obj.GetSpacing()])
file_spacing = ', '.join(
[str(f'{s:.4f}') for s in obj.GetSpacing()]
)
file_size = 'x'.join(
[str(s) for s in obj.GetLargestPossibleRegion().GetSize()]
)
Expand Down

0 comments on commit 107b820

Please sign in to comment.