Skip to content

Commit 58864d1

Browse files
authored
Merge pull request #13 from psavery/sphinx-docs
Sphinx documentation updates
2 parents c84dfc8 + af2b99d commit 58864d1

24 files changed

Lines changed: 996 additions & 622 deletions

pixi.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ platforms = ["linux-64"]
77

88
[dependencies]
99
python = "==3.12"
10-
tomviz = ">=2.1.3"
11-
h5py = "*"
10+
tomviz = ">=2.2.1"
1211
tomopy = "*"
1312

1413
[tasks]

tomviz/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,9 +625,12 @@ endforeach()
625625
set(tomviz_python_modules
626626
__init__.py
627627
_internal.py
628+
dataset.py
629+
external_dataset.py
628630
fix_pdb.py
629631
operators.py
630632
internal_dataset.py
633+
internal_utils.py
631634
itkutils.py
632635
utils.py
633636
web.py

tomviz/PtychoDialog.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "ui_PtychoDialog.h"
66

77
#include "PythonUtilities.h"
8+
#include "Utilities.h"
89

910
#include <pqApplicationCore.h>
1011
#include <pqSettings.h>
@@ -87,6 +88,8 @@ class PtychoDialog::Internal : public QObject
8788

8889
connect(ui.buttonBox, &QDialogButtonBox::accepted, this,
8990
&Internal::accepted);
91+
connect(ui.buttonBox, &QDialogButtonBox::helpRequested, this,
92+
[](){ openHelpUrl("https://tomviz.readthedocs.io/en/latest/workflows_ptycho.html"); });
9093
}
9194

9295
void setupTable()

tomviz/PtychoDialog.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
<enum>Qt::Horizontal</enum>
101101
</property>
102102
<property name="standardButtons">
103-
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
103+
<set>QDialogButtonBox::Close|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
104104
</property>
105105
</widget>
106106
</item>

tomviz/PyXRFMakeHDF5Dialog.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#include "PyXRFMakeHDF5Dialog.h"
55
#include "ui_PyXRFMakeHDF5Dialog.h"
66

7+
#include "Utilities.h"
8+
79
#include <pqApplicationCore.h>
810
#include <pqSettings.h>
911

@@ -43,6 +45,8 @@ class PyXRFMakeHDF5Dialog::Internal : public QObject
4345

4446
connect(ui.buttonBox, &QDialogButtonBox::accepted, this,
4547
&Internal::accepted);
48+
connect(ui.buttonBox, &QDialogButtonBox::helpRequested, this,
49+
[](){ openHelpUrl("https://tomviz.readthedocs.io/en/latest/workflows_pyxrf.html"); });
4650
}
4751

4852
QString command() const

tomviz/PyXRFMakeHDF5Dialog.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<enum>Qt::Horizontal</enum>
3333
</property>
3434
<property name="standardButtons">
35-
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
35+
<set>QDialogButtonBox::Close|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
3636
</property>
3737
</widget>
3838
</item>

tomviz/PyXRFProcessDialog.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "ui_PyXRFProcessDialog.h"
66

77
#include "PythonUtilities.h"
8+
#include "Utilities.h"
89

910
#include <pqApplicationCore.h>
1011
#include <pqSettings.h>
@@ -80,6 +81,8 @@ class PyXRFProcessDialog::Internal : public QObject
8081

8182
connect(ui.buttonBox, &QDialogButtonBox::accepted, this,
8283
&Internal::accepted);
84+
connect(ui.buttonBox, &QDialogButtonBox::helpRequested, this,
85+
[](){ openHelpUrl("https://tomviz.readthedocs.io/en/latest/workflows_pyxrf.html#process-projections"); });
8386
}
8487

8588
void setupTableColumns()

tomviz/PyXRFProcessDialog.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<enum>Qt::Horizontal</enum>
5353
</property>
5454
<property name="standardButtons">
55-
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
55+
<set>QDialogButtonBox::Close|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
5656
</property>
5757
</widget>
5858
</item>

tomviz/Utilities.cxx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,10 +1214,17 @@ void openUrl(const QUrl& url)
12141214

12151215
void openHelpUrl(const QString& path)
12161216
{
1217-
QString webPath = "https://tomviz.readthedocs.io/en/latest/";
1217+
QString basePath = "https://tomviz.readthedocs.io/en/latest/";
1218+
1219+
QString fullUrl;
1220+
if (!path.startsWith("http")) {
1221+
// Assume this is a relative path that needs toe base added.
1222+
fullUrl = basePath;
1223+
}
1224+
fullUrl += path;
12181225

12191226
// For now, no local paths have been added. Just use the web path.
1220-
openUrl(webPath + path);
1227+
openUrl(fullUrl);
12211228
}
12221229

12231230
double offWhite[3] = { 204.0 / 255, 204.0 / 255, 204.0 / 255 };

tomviz/python/AutoCenterOfMassTiltImageAlignment.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
class CenterOfMassAlignmentOperator(tomviz.operators.CancelableOperator):
77

8-
def transform_scalars(self, dataset):
8+
def transform(self, dataset):
99
"""Automatically align tilt images by center of mass method"""
1010
self.progress.maximum = 1
1111

12-
tiltSeries = utils.get_array(dataset).astype(float)
12+
tiltSeries = dataset.active_scalars.astype(float)
1313

1414
self.progress.maximum = tiltSeries.shape[2]
1515
step = 1
@@ -29,7 +29,7 @@ def transform_scalars(self, dataset):
2929
step += 1
3030
self.progress.value = step
3131

32-
utils.set_array(dataset, tiltSeries)
32+
dataset.active_scalars = tiltSeries
3333

3434
# Create a spreadsheet data set from table data
3535
column_names = ["X Offset", "Y Offset"]

0 commit comments

Comments
 (0)