Skip to content

Commit

Permalink
DIALS 3.14.1
Browse files Browse the repository at this point in the history
Bugfixes
--------

- ``dials.export_bitmaps``: Correctly scale resolution rings with image ``binning=`` set.
- Revert GTK-message-supression change that was causing ``reciprocal_lattice_viewer`` errors.
  • Loading branch information
DiamondLightSource-build-server committed Apr 20, 2023
2 parents 67a4693 + aef4788 commit e7f638d
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 16 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
DIALS 3.14.1 (2023-04-20)
=========================

Bugfixes
--------

- ``dials.export_bitmaps``: Correctly scale resolution rings with image ``binning=`` set. (`#2392 <https://github.com/dials/dials/issues/2392>`_)
- Revert GTK-message-supression change that was causing ``reciprocal_lattice_viewer`` errors. (`#2395 <https://github.com/dials/dials/issues/2395>`_)


DIALS 3.14.0 (2023-04-12)
=========================

Expand Down
11 changes: 9 additions & 2 deletions src/dials/command_line/export_bitmaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,21 @@ def imageset_as_bitmaps(imageset, params):
[uctbx.d_star_sq_as_d((i + 1) * step) for i in range(0, n_rings)]
)
segments, res_labels = calculate_isoresolution_lines(
spacings, beam, detector, flex_image
spacings,
beam,
detector,
flex_image,
binning=binning,
)
draw = ImageDraw.Draw(pil_img)
for segment in segments:
draw.line(segment, fill="red", width=2)
try:
import math

font = ImageFont.truetype(
"arial.ttf", size=params.resolution_rings.fontsize
"arial.ttf",
size=math.ceil(params.resolution_rings.fontsize / binning**0.5),
)
except OSError:
# Revert to default bitmap font if we must, but fontsize will not work
Expand Down
2 changes: 1 addition & 1 deletion src/dials/command_line/geometry_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ def run(args=None):

import wxtbx.app

a = wxtbx.app.CCTBXApp(0, gtk_suppress_diagnostics=True)
a = wxtbx.app.CCTBXApp(0)
a.settings = params
f = ExperimentViewer(None, -1, "Experiment viewer", size=(1024, 768))
f.load_imageset(imageset, crystal=crystal)
Expand Down
2 changes: 1 addition & 1 deletion src/dials/command_line/reciprocal_lattice_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def run(args=None):

reflections = reflections[0]

a = wxtbx.app.CCTBXApp(0, gtk_suppress_diagnostics=True)
a = wxtbx.app.CCTBXApp(0)
a.settings = params
f = ReciprocalLatticeViewer(
None,
Expand Down
4 changes: 0 additions & 4 deletions src/dials/command_line/reference_profile_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,6 @@ def run():


def show_reference_profile_viewer(data, params):
try:
wx.App.GTKSuppressDiagnostics(-1)
except AttributeError:
pass
app = wx.App()
app.frame = ProfilesFrame(data)
app.frame.Show()
Expand Down
14 changes: 10 additions & 4 deletions src/dials/util/image_viewer/spotfinder_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,13 @@ def __call__(self, *args):


def calculate_isoresolution_lines(
spacings, beam, detector, flex_image, add_text=True, n_rays=720
spacings,
beam,
detector,
flex_image,
add_text=True,
n_rays=720,
binning=1,
):

# Calculate 2θ angles
Expand Down Expand Up @@ -171,7 +177,7 @@ def calculate_isoresolution_lines(
except AttributeError:
# Single panel FlexImage
pass
vertices.append((x, y))
vertices.append((x / binning, y / binning))
paths.append(vertices)

# For each path, convert vertices to segments and add to the ring data
Expand Down Expand Up @@ -208,8 +214,8 @@ def calculate_isoresolution_lines(
x, y = txtpos
resolution_text_data.append(
(
x,
y,
x / binning,
y / binning,
f"{d:.2f}",
)
)
Expand Down
4 changes: 0 additions & 4 deletions src/dials/util/image_viewer/spotfinder_wrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ def display(self, experiments, reflections):

from dials.util.image_viewer.spotfinder_frame import SpotFrame

try:
wx.App.GTKSuppressDiagnostics(-1)
except AttributeError:
pass
app = wx.App()

self.frame = SpotFrame(
Expand Down

0 comments on commit e7f638d

Please sign in to comment.