Skip to content

Commit

Permalink
docs: update docs with more info on new viscosity model (close #136)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Feb 8, 2023
1 parent 256ee34 commit 12b94f6
Show file tree
Hide file tree
Showing 16 changed files with 163 additions and 118 deletions.
11 changes: 6 additions & 5 deletions docs/figures/qg_youngs_modulus.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@
Emax = 30

x = np.linspace(0, st["x max"], 400)
y = np.linspace(0, 0.17, 800)
y = np.linspace(0, 0.20, 800)

x, y = np.meshgrid(x, y)

emodkw = {"area_um": x,
"deform": y,
"temperature": temperature,
"px_um": pixel_size,
"visc_model": "buyukurganci-2022",
}

E_CC_1 = get_emodulus(medium="CellCarrier",
Expand Down Expand Up @@ -93,10 +94,10 @@
# start with a rectangular Figure
plt.rcParams['axes.grid'] = True
fig, ax = plt.subplots(nrows=3, ncols=3, figsize=(7, 5),
sharey=True, sharex=True)
sharey="all", sharex="all")
fig.suptitle(str(st["channel width"])+" µm channel")
ax[0, 0].set_xlim(st["x range"])
ax[0, 0].set_ylim([0, 0.17])
ax[0, 0].set_ylim([0, 0.22])
ax[2, 0].set_xlabel("Area [µm²]")
ax[2, 1].set_xlabel("Area [µm²]")
ax[2, 2].set_xlabel("Area [µm²]")
Expand All @@ -110,7 +111,7 @@
"marker": "o",
"linewidth": 0,
"zorder": 3,
"cmap": "nipy_spectral",
"cmap": "jet",
}
pem = ax[0, 0].scatter(c=E_CC_1, **scatkw)
ax[0, 1].scatter(c=E_CC_2, **scatkw)
Expand Down Expand Up @@ -142,7 +143,7 @@
row_ax.spines['left'].set_visible(False)
textkw = {"rotation": "vertical",
"fontsize": 10,
"fontweight": "demibold",
"fontweight": "semibold",
"va": "center"}
row_ax.text(0.5, 0.23, "Water", **textkw)
row_ax.text(0.5, 0.5, "CellCarrier B", **textkw)
Expand Down
Binary file modified docs/figures/qg_youngs_modulus_15um.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/figures/qg_youngs_modulus_20um.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/figures/qg_youngs_modulus_30um.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/figures/qg_youngs_modulus_40um.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions docs/scrots/make_scrots_qg_emodulus.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
mw.on_modify_slot(mw.pipeline.slot_ids[0])
mw.widget_ana_view.repaint()
wsl = mw.widget_ana_view.widget_slot
wsl.groupBox_emod.setFixedSize(420, wsl.groupBox_emod.sizeHint().height())
wsl.comboBox_visc_model.setCurrentIndex(0)
wsl.groupBox_emod.setFixedSize(420, 140)

wsl.comboBox_medium.setCurrentIndex(
wsl.comboBox_medium.findData("CellCarrier"))
Expand All @@ -52,7 +53,7 @@
wsl.comboBox_medium.setCurrentIndex(
wsl.comboBox_medium.findData("CellCarrier"))
wsl.comboBox_temp.setCurrentIndex(wsl.comboBox_temp.findData("manual"))
wsl.doubleSpinBox_temp.setValue(31)
wsl.doubleSpinBox_temp.setValue(38)
app.processEvents(QtCore.QEventLoop.AllEvents, 300)
wsl.groupBox_emod.grab().save("_qg_emodulus_badtemp.png")

Expand Down
Binary file modified docs/scrots/qg_emodulus_badtemp.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scrots/qg_emodulus_config.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scrots/qg_emodulus_feature.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scrots/qg_emodulus_other.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scrots/ui_ana_slot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/scrots/ui_main.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 12 additions & 8 deletions docs/sec_qg_youngs_modulus.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ With Shape-Out, it is possible to translate the measured area and deformation
to the Young's modulus based on numerical simulation for
fully elastic spheres according to Mokbel et al. :cite:`Mokbel2017`.

The theoretical background, including the computation of the viscosity for
the MC-PBS media used in RT-DC, is discussed in more detail in the
:ref:`dclab docs <dclab:sec_av_emodulus>`.

.. note::

Expand All @@ -22,7 +25,7 @@ Parameter settings
:target: _images/qg_emodulus_config.png
:align: right

Temperature taken from the meta data.
Temperature taken from the metadata.

.. _qg_emodulus_feature:
.. figure:: scrots/qg_emodulus_feature.png
Expand All @@ -39,7 +42,7 @@ correction), and viscosity. For known media, such as CellCarrier, the
viscosity can be derived from channel width, flow rate, and temperature.
In some RT-DC setups, the chip temperature is recorded during the measurement.
For instance, in :numref:`qg_emodulus_config`, the average chip temperature
of 22.5°C from the [setup] meta data section is used. The value of the
of 22.5°C from the [setup] metadata section is used. The value of the
resulting viscosity is shown below.
If the chip temperature is recorded for each event, then the user may select
the *From feature* option (:numref:`qg_emodulus_feature`). In this case,
Expand All @@ -53,10 +56,10 @@ the Young's modulus is computed from the individual viscosities for each event.

Temperature outside of known range.

If the temperature is not given as a feature or as meta data, then
If the temperature is not given as a feature or as metadata, then
you may select the temperature manually. This case is visualized in
:numref:`qg_emodulus_badtemp`. Here, the temperature is purposely set outside of
the known range defined in :cite:`Herold2017`, which is highlighted by
the known range defined in :cite:`Buyukurganci2022`, which is highlighted by
coloring the viscosity red.

.. _qg_emodulus_other:
Expand All @@ -70,7 +73,7 @@ You may also set the viscosity manually by selecting *other* as a medium
(:numref:`qg_emodulus_other`).
In this case, the values for temperature are irrelevant. Please only use
this option if you know what you are doing (e.g. you have considered
shear-thinning :cite:`Herold2017`).
shear-thinning and temperature-dependence :cite:`Herold2017, Buyukurganci2022`).

Click *Apply* for any changes to take effect. The Young's modulus is then
available for the selected dataset.
Expand All @@ -91,7 +94,7 @@ for all datasets of the current session. Note that the options
in this dialog do not necessarily reflect the options available for the
individual datasets. Only valid options are adopted. For instance,
you will not be able to change the medium for a dataset if a medium is
already given in its meta data. To verify the options set, you can always
already given in its metadata. To verify the options set, you can always
check the current setting via the *Analysis View* (see above).


Expand All @@ -114,8 +117,9 @@ is checked in the *Filter* configuration tab.
shown depend on the channel size, the flow rate, the temperature,
and the viscosity of the medium :cite:`Mietke2015`.
Here, they are computed for a 20 µm wide channel at 23°C with an
effective pixel size of 0.34 µm. The data are corrected for pixelation
effects according to :cite:`Herold2017`.
effective pixel size of 0.34 µm. The viscosity of the MC-PBS buffers
is computed according to :cite:`Buyukurganci2022` and the data are corrected
for pixelation effects according to :cite:`Herold2017`.

The invalid regions (white in the figure above) include objects that
are very small or objects with very low deformation values.
Expand Down
10 changes: 10 additions & 0 deletions docs/shapeout.bib
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,14 @@ @Misc{NawUrb2019data
publisher = {figshare},
}

@Article{Buyukurganci2022,
author = {Büyükurgancı, Beyza and Basu, Santanu Kumar and Neuner, Markus and Guck, Jochen and Wierschem, Andreas and Reichel, Felix},
title = {Shear rheology of methyl cellulose based solutions for cell mechanical measurements at high shear rates},
journal = {Soft Matter},
year = {2023},
pages = {-},
doi = {10.1039/D2SM01515C},
publisher = {The Royal Society of Chemistry},
}

@Comment{jabref-meta: databaseType:bibtex;}
22 changes: 15 additions & 7 deletions shapeout2/gui/analysis/ana_slot.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,16 @@ def on_ui_changed(self):
tselec = self.comboBox_temp.currentData()
medium_key = ALIAS_MEDIA.get(medium, medium)
visc_model = self.comboBox_visc_model.currentText()
# Only show model selection if we are dealing with MC-PBS
self.comboBox_visc_model.setVisible(medium_key.count("MC-PBS"))
self.doubleSpinBox_visc.setStyleSheet("")
if medium in KNOWN_MEDIA: # medium registered with dclab
self.label_temp.setVisible(True)
self.comboBox_temp.setVisible(True)
self.doubleSpinBox_temp.setVisible(True)
self.comboBox_temp.setEnabled(True)
self.doubleSpinBox_visc.setEnabled(True)
self.doubleSpinBox_visc.setReadOnly(True)
# Only show model selection if we are dealing with MC-PBS
self.comboBox_visc_model.setVisible(medium_key.count("MC-PBS"))
if tselec == "manual":
temperature = self.doubleSpinBox_temp.value()
self.doubleSpinBox_temp.setEnabled(True)
Expand All @@ -370,6 +374,7 @@ def on_ui_changed(self):
elif tselec == "feature":
temperature = np.nan
self.doubleSpinBox_temp.setEnabled(False)
self.doubleSpinBox_temp.setVisible(False)
self.doubleSpinBox_temp.setValue(temperature)
else:
assert tselec is None, "We should still be in init"
Expand All @@ -396,29 +401,32 @@ def on_ui_changed(self):
break
else:
vstyle = "border-width: 2px"
self.doubleSpinBox_visc.setVisible(True)
self.doubleSpinBox_visc.setEnabled(True)
self.doubleSpinBox_visc.setReadOnly(True)
self.doubleSpinBox_visc.setValue(visc)
self.doubleSpinBox_visc.setStyleSheet(vstyle)
else:
self.doubleSpinBox_visc.setEnabled(False)
self.doubleSpinBox_visc.setVisible(False)
self.doubleSpinBox_visc.setReadOnly(True)
self.doubleSpinBox_visc.setValue(np.nan)
self.doubleSpinBox_visc.setStyleSheet("border-width: 2px")
elif medium == "undefined":
self.comboBox_temp.setEnabled(False)
self.label_temp.setVisible(False)
self.comboBox_temp.setVisible(False)
self.doubleSpinBox_temp.setVisible(False)
self.doubleSpinBox_temp.setEnabled(False)
self.doubleSpinBox_temp.setValue(np.nan)
self.doubleSpinBox_visc.setValue(np.nan)
self.doubleSpinBox_visc.setEnabled(False)
self.doubleSpinBox_visc.setStyleSheet("border-width: 2px")
else: # "other" or user-defined
self.comboBox_temp.setEnabled(False)
self.label_temp.setVisible(False)
self.comboBox_temp.setVisible(False)
self.doubleSpinBox_temp.setVisible(False)
self.doubleSpinBox_temp.setEnabled(False)
self.doubleSpinBox_temp.setValue(np.nan)
self.doubleSpinBox_visc.setEnabled(True)
self.doubleSpinBox_visc.setReadOnly(False)
self.doubleSpinBox_visc.setStyleSheet("border-width: 2px")

def set_pipeline(self, pipeline):
self._pipeline = pipeline
Expand Down

0 comments on commit 12b94f6

Please sign in to comment.