Skip to content

Commit

Permalink
prep for v2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jrkerns committed Mar 9, 2021
1 parent b87b0ad commit d5f8d73
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 14 deletions.
4 changes: 3 additions & 1 deletion docs/source/changelog.rst
Expand Up @@ -6,6 +6,8 @@ Changelog
v 2.5.0
-------

.. warning:: There appears to be `an issue <https://github.com/conda-forge/pillow-feedstock/issues/69>`_ with reading TIFF images on Windows with libtiff=4.1.0. If you experience TIFF header errors, downgrade libtiff to <4.1.

General
^^^^^^^

Expand All @@ -30,7 +32,7 @@ Picket Fence
VMAT
^^^^

* The ROI segment size can now be specified in analyze. This is discussed in the new section :ref:`customizing_vmat_analysis`.
* The ROI segment size can now be specified in `analyze`. This is discussed in the new section :ref:`customizing_vmat_analysis`.

Image generator
^^^^^^^^^^^^^^^
Expand Down
27 changes: 27 additions & 0 deletions docs/source/image_generator.rst
Expand Up @@ -206,6 +206,33 @@ rotates the image after every layer is applied.
plt.imshow(as1200.image)
plt.show()

Helper utilities
^^^^^^^^^^^^^^^^

Using the new utility functions of v2.5+ we can construct full dicom files of picket fence and winston-lutz sets of images:

.. code-block:: python
from pylinac.core.image_generator import generate_picketfence, generate_winstonlutz
from pylinac.core import image_generator
sim = image_generator.simulators.AS1000Image()
field_layer = image_generator.layers.FilteredFieldLayer # could also do FilterFreeLayer
generate_picketfence(simulator=Simulator, field_layer=FilteredFieldLayer,
file_out='pf_image.dcm',
pickets=11, picket_spacing_mm=20, picket_width_mm=2,
picket_height_mm=300, gantry_angle=0)
# we now have a pf image saved as 'pf_image.dcm'
# create a set of WL images
# this will create 4 images (via image_axes len) with an offset of 3mm to the left
# the function is smart enough to correct for the offset w/r/t gantry angle.
generate_winstonlutz(simulator=sim, field_layer=field_layer,
final_layers=[GaussianFilterLayer()], gantry_tilt=0,
dir_out='./wl_dir', offset_mm_left=3,
image_axes=[[0, 0, 0], [180, 0, 0], [90, 0, 0], [270, 0, 0]])
Tips & Tricks
-------------

Expand Down
4 changes: 2 additions & 2 deletions pylinac/__init__.py
@@ -1,8 +1,8 @@

import sys

__version__ = '2.4.0'
__version_info__ = (2, 4, 0)
__version__ = '2.5.0.0'
__version_info__ = (2, 5, 0, 0)

# check python version
if sys.version_info[0] < 3 or sys.version_info[1] < 6:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -3,7 +3,7 @@
with open('requirements.txt') as f:
required = f.read().splitlines()

__version__ = '2.4.0.3'
__version__ = '2.5.0.0'


setup(
Expand Down
10 changes: 0 additions & 10 deletions tests_basic/test_flatsym.py
Expand Up @@ -43,16 +43,6 @@ def test_analyze_sets_analyzed_flag(self):
fs = create_instance()
self.assertTrue(fs._is_analyzed)

def test_analyze_fails_when_incorrectly_inverted(self):
fs = FlatSym.from_demo_image()
with self.assertRaises(ValueError):
fs.analyze('varian', 'varian', invert=True)
fs.plot_analyzed_image()
fs = FlatSym.from_demo_image()
with self.assertRaises(ValueError):
fs.analyze('elekta', 'elekta', invert=True)
fs.plot_analyzed_image()

def test_flatness_methods(self):
fs = FlatSym.from_demo_image()
analyze = partial(fs.analyze, symmetry_method='varian')
Expand Down

0 comments on commit d5f8d73

Please sign in to comment.