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()
andprocess()
that directly accept Operations.Added new arguments to ML Operations initializers that were previously only accessible through configure.
Removed bindings for
Image
. UseImageDescriptor
instead andPixelType
instead ofImage.Type
.Added min and max to
imagemath
.Added bindings for imagemath module
imagemath
with the submodulelazy
. Some methods were also added toSharedImage
andSharedImageSet
besidesimagemath
.Added basic bindings for
ImageRegistrationAlgorithm
andRegistrationInitAlgorithm
.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 aSharedImage
into a numpy array, shift and scale may determine a more complex change of pixel type. As an example, if aMemImage
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 forMemImage
andSharedImage
: it now returns original values and, hence, shift and scale are considered. A more complex change of pixel type may occur such that all theSharedImage
instances can be represented without loss of information.
Breaking Changes:
MemImage.image_to_pixel_matrix
is now a read-only property, making it consistent withMemImage.pixel_to_image_matrix
.SharedImage.matrix
has been removed, please useSharedImage.world_to_image_matrix
instead.The function
remove_loggers()
is not available anymore.The function
registerLogger()
has been renamed astransfer_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 callingtransfer_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 theIMFUSION_LICENSE_KEY
environment variable (see Installation).registerAlgorithm()
now takes an algorithmid
as well asname
.availableAlgorithms()
now returns a list ofid
instead ofname
.createAlgorithm()
now takes an algorithmid
instead ofname
.executeAlgorithm()
now takes an algorithmid
instead ofname
.algorithmProperties()
now takes an algorithmid
instead ofname
.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
andopenvino
to theimfusion.machinelearning
module.
August 2023
Breaking Changes:
numpy
is now a mandatory requirementDropped 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:
DataGroup
has no more indexing methods for its children. UseDataGroup.children()
orDataGroup.childrenRecursive()
instead.
October 2022
Breaking Changes:
Adding
Data
to theDataModel
will now create a copy instead of transferring ownership. This should prevent common crashes related to theDataModel
.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 addedimfusion.io.open()
, addedimfusion.io.write()
.
September 2020
SharedImage
is now allowed to have more than 4 channels
August 2020
std::shared_ptr
is used to trackMemImage
andSharedImage
internally. This should have no effect on existing Python code but improves general memory safety. E.g. referencing aSharedImage
after its parentSharedImageSet
was deleted does not cause an access violation anymore.Removed option to create non-owning
SharedImageSet
. Due to thestd::shared_ptr
change, these are not needed anymore. It’s now perfectly valid to add a singleSharedImage
to two separateSharedImageSet
.
February 2020
Added bindings for
Display
andAnnotation
.
November 2019
Breaking Changes:
Removed previously deprecated functions in
ApplicationController
andProperties
Deprecated
DataList
. All function that usedDataList
before now use a regular Pythonlist
. This especially affectsAlgorithm.convert_input()
, since the data argument is now alist
and you cannot callDataList.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 withinit()
.Added
open()
,executeAlgorithm()
andcreateAlgorithm()
.Moved
availableAlgorithms()
,algorithmProperties()
,registerAlgorithm()
andunregisterAlgorithm()
to globalimfusion
namespace. The corresponding method inApplicationController
are deprecated.