Skip to content
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

Change refinement toolbox presets #361

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/napari_stress/_measurements/toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,15 @@ def eventFilter(self, obj: QObject, event: QEvent):

def _check_minimal_point_number(self) -> None:
"""Check if number of quadrature point complies with max_degree."""
minimal_point_number = lebedev_info_SPB.pts_of_lbdv_lookup[
self.spinBox_max_degree.value()
]
# lebedev_info_SPB.pts_of_lbdv_lookup is a dictionary of the form
# {degree: number of quadrature points}
# if no value for the given key exists, pick the next higher value.
max_degree = self.spinBox_max_degree.value()
lookup = lebedev_info_SPB.pts_of_lbdv_lookup
for degree in range(max_degree, list(lookup.keys())[-1] + 1):
if degree in lookup.keys():
minimal_point_number = lookup.get(degree)
break

if self.comboBox_quadpoints.currentData() < minimal_point_number:
index = self.comboBox_quadpoints.findData(minimal_point_number)
Expand Down
10 changes: 8 additions & 2 deletions src/napari_stress/_reconstruction/toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def __init__(self, napari_viewer):
# populate comboboxes with allowed values
self.comboBox_fittype.addItems(["fancy", "quick"])
self.comboBox_fluorescence_type.addItems(["interior", "surface"])
self.comboBox_interpolation_method.addItems(["linear", "cubic"])
self.comboBox_interpolation_method.addItems(["cubic", "linear"])
self.comboBox_interpolation_method.setCurrentText("linear")

# calculate density/point number
self.spinBox_n_vertices.setValue(256)
Expand All @@ -59,6 +60,10 @@ def _set_scales(self):
self.doubleSpinBox_voxelsize_x.setValue(scales[2])
self.doubleSpinBox_voxelsize_y.setValue(scales[1])
self.doubleSpinBox_voxelsize_z.setValue(scales[0])

# set target voxel size to mean of scales as default
mean_scale = np.mean([scales[0], scales[2]])
self.doubleSpinBox_target_voxelsize.setValue(mean_scale)
except Exception:
pass

Expand Down Expand Up @@ -327,7 +332,7 @@ def reconstruct_droplet(
"surface",
)

properties = {"name": "points_patch_fitted", "size": 0.5}
properties = {"name": "Droplet pointcloud (smoothed)", "size": 0.5}
layer_patch_fitted = (
points * target_voxelsize,
properties,
Expand All @@ -338,6 +343,7 @@ def reconstruct_droplet(
layer_label_image = (label_image, properties, "labels")

traced_points = list(traced_points)
traced_points[1]["name"] = "Droplet pointcloud (traced)"
traced_points[0] *= target_voxelsize

trace_vectors = list(trace_vectors)
Expand Down
29 changes: 16 additions & 13 deletions src/napari_stress/_reconstruction/toolbox.ui
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@
<item row="1" column="0" colspan="2">
<widget class="QToolBox" name="toolBox">
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="page_3">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>125</width>
<height>118</height>
<width>855</width>
<height>253</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -173,8 +173,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>147</width>
<height>93</height>
<width>855</width>
<height>253</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -237,7 +237,7 @@
<item row="2" column="3">
<widget class="QSpinBox" name="spinBox_n_smoothing">
<property name="value">
<number>10</number>
<number>15</number>
</property>
</widget>
</item>
Expand All @@ -254,9 +254,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<y>-29</y>
<width>838</width>
<height>318</height>
<height>341</height>
</rect>
</property>
<attribute name="label">
Expand Down Expand Up @@ -344,7 +344,7 @@
<double>1.000000000000000</double>
</property>
<property name="value">
<double>2.500000000000000</double>
<double>5.000000000000000</double>
</property>
</widget>
</item>
Expand Down Expand Up @@ -400,7 +400,7 @@
<double>0.250000000000000</double>
</property>
<property name="value">
<double>0.500000000000000</double>
<double>1.000000000000000</double>
</property>
</widget>
</item>
Expand All @@ -420,7 +420,7 @@
<double>2.000000000000000</double>
</property>
<property name="value">
<double>10.000000000000000</double>
<double>20.000000000000000</double>
</property>
</widget>
</item>
Expand Down Expand Up @@ -461,14 +461,17 @@
<item row="6" column="0">
<widget class="QCheckBox" name="checkBox_use_dask">
<property name="text">
<string>Parallelize with dask</string>
<string>Parallelize with dask (only timelapse)</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QCheckBox" name="checkBox_return_intermediate">
<property name="text">
<string>Return intermediate resultss (may require a lot of memory)</string>
<string>Return intermediate results (may require a lot of memory)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
Expand Down
Loading