Skip to content

Commit

Permalink
Roi in liveview (#151)
Browse files Browse the repository at this point in the history
Co-authored-by: Jason Person <jason.person@curibio.com>
  • Loading branch information
tannermpeterson and jperson authored Jan 31, 2025
1 parent 622fa7c commit da10cb1
Show file tree
Hide file tree
Showing 13 changed files with 211 additions and 104 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,13 @@ jobs:
git push origin ${NAUTILAI_VERSION}
- name: Upload installer
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: ./build/Nautilai-${{env.NAUTILAI_VERSION}}-win64.exe
name: "Nautilai-${{env.NAUTILAI_VERSION}}-nsis"

- name: Upload zip
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: ./build/Nautilai-${{env.NAUTILAI_VERSION}}-win64.zip
name: "Nautilai-${{env.NAUTILAI_VERSION}}"
Expand All @@ -328,7 +328,7 @@ jobs:
run: |
echo "${{ steps.create_release.outputs.upload_url }}" > ./upload_url
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: ./upload_url
name: upload_url
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/local_analysis_pyinstaller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
pip install -r src/requirements-dev.txt
pip install -r src/requirements.txt
pyinstaller -i app/icon/logo.ico -F src/local_analysis.py
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: local_analysis
path: src/local_analysis/dist/*
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Added:
- 8-bit imaging (high speed mode) support
- Verification of drive serial number on start up. Uses new `disk.hd_serial_num` field in machine.toml as the
expected value
- ROI display in Live View. Can be toggled under Advanced Setup and initialized using
`acquisition.live_view.display_rois_during_live_view` bool in nautilai.toml

Changed:
^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions resources/nautilai.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ p2 = 2111

[acquisition.live_view]
enable_live_view_during_acquisition = true
display_rois_during_live_view = true

[postprocess]

Expand Down
14 changes: 14 additions & 0 deletions src/app/src/advancedsetupdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ void AdvancedSetupDialog::setDefaultValues() {
m_enableDownsampleRawFiles = m_config->enableDownsampleRawFiles;
m_keepOriginalRaw = m_config->keepOriginalRaw;
m_enableLiveViewDuringAcquisition = m_config->enableLiveViewDuringAcquisition;
m_displayRoisDuringLiveView = m_config->displayRoisDuringLiveView;

for (int i=0; i<ui->ledDeviceList->count(); i++) {
if (ui->ledDeviceList->itemText(i).toStdString() == m_config->niDev) {
Expand Down Expand Up @@ -93,6 +94,7 @@ void AdvancedSetupDialog::setDefaultValues() {
ui->triggerModeList->setCurrentIndex(currentTrigModeIndex);

ui->checkEnableLiveViewDuringAcq->setChecked(m_enableLiveViewDuringAcquisition);
ui->checkDisplayRoisDuringLiveView->setChecked(m_displayRoisDuringLiveView);

ui->binFactorList->setCurrentIndex((m_binFactor / 2) - 1);
ui->binFactorList->setEnabled(m_enableDownsampleRawFiles);
Expand All @@ -111,6 +113,7 @@ void AdvancedSetupDialog::updateAdvancedSetup(){

emit this->sig_trigger_mode_change(m_triggerMode);
emit this->sig_enable_live_view_during_acquisition_change(m_enableLiveViewDuringAcquisition);
emit this->sig_display_rois_during_live_view_change(m_displayRoisDuringLiveView);

m_config->enableDownsampleRawFiles = m_enableDownsampleRawFiles;
m_config->binFactor = m_binFactor;
Expand Down Expand Up @@ -182,6 +185,17 @@ void AdvancedSetupDialog::on_checkEnableLiveViewDuringAcq_stateChanged(int state
m_enableLiveViewDuringAcquisition = state;
}


/*
* When user updates this checkbox, save changes to be confirmed later.
*
* @param new checked state
*/
void AdvancedSetupDialog::on_checkDisplayRoisDuringLiveView_stateChanged(int state) {
m_displayRoisDuringLiveView = state;
}


/*
* When user updates this checkbox, disabled/enable binning factor dropdown accordingly.
*
Expand Down
3 changes: 3 additions & 0 deletions src/app/src/advancedsetupdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class AdvancedSetupDialog : public QDialog{
void sig_ni_dev_change(std::string m_niDev, std::string m_trigDev);
void sig_trigger_mode_change(int16_t triggerMode);
void sig_enable_live_view_during_acquisition_change(bool enable);
void sig_display_rois_during_live_view_change(bool enable);
void sig_close_adv_settings();

private slots:
Expand All @@ -40,6 +41,7 @@ class AdvancedSetupDialog : public QDialog{
void on_triggerDeviceList_currentTextChanged(const QString &text);
void on_triggerModeList_currentTextChanged(const QString &text);
void on_checkEnableLiveViewDuringAcq_stateChanged(int state);
void on_checkDisplayRoisDuringLiveView_stateChanged(int state);
void on_checkDownsampleRawFiles_stateChanged(int state);
void on_checkKeepOriginalRaw_stateChanged(int state);
void on_binFactorList_currentTextChanged(const QString &text);
Expand All @@ -54,6 +56,7 @@ class AdvancedSetupDialog : public QDialog{
std::string m_trigDev;
int16_t m_triggerMode;
bool m_enableLiveViewDuringAcquisition;
bool m_displayRoisDuringLiveView;
bool m_enableDownsampleRawFiles;
bool m_keepOriginalRaw;
uint8_t m_binFactor;
Expand Down
142 changes: 87 additions & 55 deletions src/app/src/advancedsetupdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>581</width>
<height>360</height>
<height>381</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -17,9 +17,9 @@
<property name="geometry">
<rect>
<x>310</x>
<y>40</y>
<y>38</y>
<width>241</width>
<height>21</height>
<height>30</height>
</rect>
</property>
</widget>
Expand All @@ -43,7 +43,7 @@
<property name="geometry">
<rect>
<x>220</x>
<y>310</y>
<y>330</y>
<width>150</width>
<height>30</height>
</rect>
Expand Down Expand Up @@ -72,27 +72,11 @@
<property name="geometry">
<rect>
<x>310</x>
<y>100</y>
<y>98</y>
<width>241</width>
<height>22</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkEnableLiveViewDuringAcq">
<property name="geometry">
<rect>
<x>310</x>
<y>130</y>
<width>21</width>
<height>21</height>
<height>30</height>
</rect>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
Expand All @@ -104,7 +88,7 @@
</rect>
</property>
<property name="text">
<string>Enable live view during acquisition:</string>
<string>Enable Live View During Acquisition:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
Expand All @@ -114,39 +98,23 @@
<property name="geometry">
<rect>
<x>10</x>
<y>160</y>
<y>192</y>
<width>261</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Downsample raw data file:</string>
<string>Downsample Raw Data File:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QCheckBox" name="checkDownsampleRawFiles">
<property name="geometry">
<rect>
<x>310</x>
<y>160</y>
<width>21</width>
<height>21</height>
</rect>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="label_5">
<property name="geometry">
<rect>
<x>10</x>
<y>190</y>
<y>222</y>
<width>261</width>
<height>21</height>
</rect>
Expand All @@ -168,9 +136,9 @@
<property name="geometry">
<rect>
<x>310</x>
<y>190</y>
<y>222</y>
<width>91</width>
<height>22</height>
<height>30</height>
</rect>
</property>
<item>
Expand Down Expand Up @@ -198,7 +166,7 @@
<property name="geometry">
<rect>
<x>10</x>
<y>220</y>
<y>252</y>
<width>261</width>
<height>21</height>
</rect>
Expand All @@ -207,7 +175,7 @@
<string notr="true"/>
</property>
<property name="text">
<string>Keep original:</string>
<string>Keep Original:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
Expand All @@ -216,10 +184,10 @@
<widget class="QCheckBox" name="checkKeepOriginalRaw">
<property name="geometry">
<rect>
<x>310</x>
<y>220</y>
<x>305</x>
<y>252</y>
<width>21</width>
<height>21</height>
<height>30</height>
</rect>
</property>
<property name="layoutDirection">
Expand Down Expand Up @@ -249,17 +217,17 @@
<property name="geometry">
<rect>
<x>310</x>
<y>70</y>
<y>68</y>
<width>241</width>
<height>21</height>
<height>30</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_8">
<property name="geometry">
<rect>
<x>10</x>
<y>250</y>
<y>282</y>
<width>261</width>
<height>21</height>
</rect>
Expand All @@ -268,7 +236,7 @@
<string notr="true"/>
</property>
<property name="text">
<string>Video Quality</string>
<string>Video Quality:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
Expand All @@ -278,11 +246,75 @@
<property name="geometry">
<rect>
<x>310</x>
<y>250</y>
<y>280</y>
<width>241</width>
<height>22</height>
<height>30</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_9">
<property name="geometry">
<rect>
<x>10</x>
<y>160</y>
<width>261</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Display ROIs During Live View:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QCheckBox" name="checkDownsampleRawFiles">
<property name="geometry">
<rect>
<x>305</x>
<y>190</y>
<width>21</width>
<height>30</height>
</rect>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QCheckBox" name="checkDisplayRoisDuringLiveView">
<property name="geometry">
<rect>
<x>305</x>
<y>160</y>
<width>21</width>
<height>30</height>
</rect>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QCheckBox" name="checkEnableLiveViewDuringAcq">
<property name="geometry">
<rect>
<x>305</x>
<y>130</y>
<width>21</width>
<height>30</height>
</rect>
</property>
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</widget>
<resources/>
Expand Down
Loading

0 comments on commit da10cb1

Please sign in to comment.