------------------
* New :mod:`pymia.deeplearning` package
* New extractor :class:`.PadDataExtractor`, which replaces the ``PadPatchDataExtractor`` (see migration guide below)
* New metrics :class:`.NormalizedRootMeanSquaredError`, :class:`.SurfaceDiceOverlap`, and :class:`.SurfaceOverlap`
* Faster and more generic implementation of :class:`.HausdorffDistance`
* New data augmentation module :mod:`pymia.data.augmentation`
* New filter :class:`.BinaryThreshold`
* Replaced the transformation in :class:`.SubjectAssembler` by a more flexible function (see migration guide below)
* Minor bug fixes and maintenance
* Several improvements to the documentation
We kindly appreciate the help of our contributors:
- Jan Riedo
- Yannick Soom
Migration guide
^^^^^^^^^^^^^^^
The extractor ``PadPatchDataExtractor`` has been replaced by the :class:`.PadDataExtractor` to facilitate the
extraction flexibility. The :class:`.PadDataExtractor` works now with any kind of the three data extractors
(:class:`.DataExtractor`, :class:`.RandomDataExtractor`, and :class:`.SelectiveDataExtractor`),
which are passed as argument. Further, it is now possible to pass a function for the padding as argument to replace the
default zero padding. Suppose you used the ``PadPatchDataExtractor`` like this:
.. code-block:: python
import pymia.data.extraction as pymia_extr
pymia_extr.PadPatchDataExtractor(padding=(10, 10, 10), categories=('images',))
To have the same behaviour, replace it by:
.. code-block:: python
import pymia.data.extraction as pymia_extr
pymia_extr.PadDataExtractor(padding=(10, 10, 10),
extractor=pymia_extr.DataExtractor(categories=('images',)))
The transformation in :meth:`.SubjectAssembler.add_batch` has been removed and replaced by the ``on_sample_fn``
parameter in the constructor. Replacing the transformation by this function should be straight forward by rewriting your
transformation as function:
.. code-block:: python
def on_sample_fn(params: dict):
key = '__prediction'
batch = params['batch']
idx = params['batch_idx']
data = params[key]
index_expr = batch['index_expr'][idx]
manipulate data and index_expr according to your needs
return data, index_expr