Changelog

0.8.0

  • Fixed discrepancy between configuration and attributes of PythonOperations constructed through OperationsSequence.

  • Added repr for DatasetLicenseComponent.

  • Fixed timing calculation when Dataset is set to verbose.

  • Fixed verbosity setting in Dataset.

  • Added new overloads for sample() and process() that directly accept Operations.

  • Added new arguments to ML Operations initializers that were previously only accessible through configure.

  • Removed bindings for Image. Use ImageDescriptor instead and PixelType instead of Image.Type.

  • Added min and max to imagemath.

  • Added bindings for imagemath module imagemath with the submodule lazy. Some methods were also added to SharedImage and SharedImageSet besides imagemath.

  • Added basic bindings for ImageRegistrationAlgorithm and RegistrationInitAlgorithm.

  • Added function open_in_suite() to start an ImFusion Suite instance with the provided data list. This method requires the ImFusion Suite executable to be installed and in the PATH.

  • Fixed a bug for which, after transferring logging to python, some logging was not occurring.

  • Fixed a bug for which the logging was directed to the stdout after transferring logging to python but before importing the logging module (which was not expected accordingly to the documentation). Hence, importing the imfusion python library does not implicitly import the python logging module anymore. Once the logging is imported after the call to transfer_logging_to_python, then the logs are directed to the stdout.

  • It is not possible anymore to revert the effect of transferring logging to python.

  • Fixed a bug for which assigning +/-sys.float_info.max value, or some close values to those, to Properties was leading to a broken entry.

  • Support Properties params of type Path, by casting paths to or from pathlib.Path.

  • Fixed a DataElement.clone() bug leading to the with_data argument being ignored.

  • When converting a MemImage or a SharedImage into a numpy array, shift and scale may determine a more complex change of pixel type. As an example, if a MemImage is unsigned but the shift is such that it would be representing negative values as well, then the numpy type will be of signed type rather than unsigned.

  • When converting a SharedImageSet into a numpy array, it now works likewise for MemImage and SharedImage: it now returns original values and, hence, shift and scale are considered. A more complex change of pixel type may occur such that all the SharedImage instances can be represented without loss of information.

Breaking Changes:

  • MemImage.image_to_pixel_matrix is now a read-only property, making it consistent with MemImage.pixel_to_image_matrix.

  • SharedImage.matrix has been removed, please use SharedImage.world_to_image_matrix instead.

  • The function remove_loggers() is not available anymore.

  • The function registerLogger() has been renamed as transfer_logging_to_python(). However, it now cannot be reverted anymore as, after calling this function, logging.getLogger(“ImFusion”) becomes the logging interface.

  • The function set_log_level() does not have any effect after calling transfer_logging_to_python(), as logging.getLogger(“ImFusion”).setLevel becomes the interface for setting the log level. When this happens, a WARNING reminder is logged.

  • In the cases of int, float, str, bool and list values, Properties directly returns values with the original types.

  • Since the types do need to be specified, the enum ParamCast and the class Param have been removed. In the cast of vectors and matrices, Properties.param() function needs to be called with an argument of the required type, so that the desired type can be returned. Currently matrices and vectors will otherwise be returned in their internal string representation.

  • Subproperty keys now require the subproperty name, followed by a ‘/’, and then followed by the index of that subproperty name at the given dictionary level. This syntax replaces lists of subproperties, which are no longer supported.

  • The Properties.params function only returns the list of parameters at the first dictionary level, instead than doing it recursively. In fact, it is no longer possible to get the nested list of parameters using the Properties.params function at the root Properties insteance: instead the Properties.params function will need to be called at the required dictionary level.

Older Releases

February 2024

Breaking Changes:

  • Changed API of image processing methods in MemImage (rotate(), threshold(), etc.): They no longer return bools as a status indicator but raise exceptions instead. The images are also no longer modified in-place and a clone is processed and returned instead (same as numpy or pandas).

  • Major refactoring of the Python API. Method, function and variable names are now all snake_case. Enum members are all UPPER_CASE_WITH_UNDERSCORES. Getter (and setter) methods have been converted to Python properties, which means that they can no longer be called like functions but return the values on attribute access.

  • imfusion.init() has been removed and is now called implicitly when the module is imported. Use imfusion.info() to get information about the OpenGL context and available plugins.

  • License check is now performed at import time of the imfusion package. You can activate it by running setting the IMFUSION_LICENSE_KEY environment variable (see Installation).

  • registerAlgorithm() now takes an algorithm id as well as name.

  • availableAlgorithms() now returns a list of id instead of name.

  • createAlgorithm() now takes an algorithm id instead of name.

  • executeAlgorithm() now takes an algorithm id instead of name.

  • algorithmProperties() now takes an algorithm id instead of name.

  • SharedImage.numpy() has no copy argument anymore and it always returns a copy

  • SharedImage.numpy() returns the array already shifted, scaled and correctly typed. This should improve on usability since the user does not need to perform extra manual work anymore

  • Subproperties of Properties can now be accessed in a dictionary-like fashion (e.g. p[‘sub’][‘field’]). However, for consistency reasons keys constructed using the ‘/’ character (e.g. p[‘sub/field’]), which are still returned by the params() function, cannot be used to access subproperties params anymore.

  • Dictionaries returned by Properties instances now contain Param instances instead of the corresponding string casts.

  • Added Python-based engines for torch, onnxruntime and openvino to the imfusion.machinelearning module.

August 2023

Breaking Changes:

  • numpy is now a mandatory requirement

  • Dropped support for Python 3.6 and 3.7

March 2023

Breaking Changes:

  • The repr format of enums has changed. It now includes the underlying integer value. E.g. repr(Image.Type.UBYTE) now returns ‘<Type.UBYTE: 5121>’ instead of ‘Type.UBYTE’.

  • Dropped support for Python 3.5

November 2022

Breaking Changes:

October 2022

Breaking Changes:

  • Adding Data to the DataModel will now create a copy instead of transferring ownership. This should prevent common crashes related to the DataModel.

  • DataModel.add() now returns the copy and raises an exception if the given data could not be added.

  • DataModel.remove() now raises an exception if the given data could not be removed.

July 2022

  • Deprecated imfusion.open() in favor of newly added imfusion.io.open(), added imfusion.io.write().

September 2020

  • SharedImage is now allowed to have more than 4 channels

August 2020

  • std::shared_ptr is used to track MemImage and SharedImage internally. This should have no effect on existing Python code but improves general memory safety. E.g. referencing a SharedImage after its parent SharedImageSet was deleted does not cause an access violation anymore.

  • Removed option to create non-owning SharedImageSet. Due to the std::shared_ptr change, these are not needed anymore. It’s now perfectly valid to add a single SharedImage to two separate SharedImageSet.

February 2020

November 2019

Breaking Changes:

  • Removed previously deprecated functions in ApplicationController and Properties

  • Deprecated DataList. All function that used DataList before now use a regular Python list. This especially affects Algorithm.convert_input(), since the data argument is now a list and you cannot call DataList.getImages() anymore. Instead you can use a list comprehension to filter all images: [i for i in data if isinstance(i, imfusion.SharedImageSet)]. Also check the updated Writing Algorithms section.

June 2019

  • Made ApplicationController mostly optional. The framework can now be initialized with init().

  • Added open(), executeAlgorithm() and createAlgorithm().

  • Moved availableAlgorithms(), algorithmProperties(), registerAlgorithm() and unregisterAlgorithm() to global imfusion namespace. The corresponding method in ApplicationController are deprecated.