From 89c86c79200705f4344ac0df80345ca440b13c8b Mon Sep 17 00:00:00 2001 From: Sara Bosticardo Date: Fri, 3 Oct 2025 11:50:49 +0200 Subject: [PATCH 1/3] Correction weighted lasso variables --- commit/core.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commit/core.pyx b/commit/core.pyx index 20f12d6..011520a 100644 --- a/commit/core.pyx +++ b/commit/core.pyx @@ -796,10 +796,10 @@ cdef class Evaluation : if self.A is None : logger.error( 'Operator not built; call "build_operator()" first' ) - if self.DICTIONARY['IC']['nF'] <= 0 : + if self.DICTIONARY['IC']['nSTR'] <= 0 : logger.error( 'No streamline found in the dictionary; check your data' ) - if int( self.DICTIONARY['nV'] * self.KERNELS['iso'].shape[0] ) == 0 : + if int( self.DICTIONARY['ISO']['n'] * self.KERNELS['iso'].shape[0] ) == 0 : logger.error( 'Unable to set regularisation because no isotropic compartment found in the dictionary.' ) # load image and check it @@ -827,7 +827,7 @@ cdef class Evaluation : # compute array of weights from image array_weights = weights_img[ self.DICTIONARY['MASK_ix'], self.DICTIONARY['MASK_iy'], self.DICTIONARY['MASK_iz'] ].flatten().astype(np.float32) - if array_weights.size != self.DICTIONARY['nV']: + if array_weights.size != self.DICTIONARY['ISO']['n']: logger.error( 'Number of voxels in the weights image does not match the number of voxels in the dictionary' ) if np.any(array_weights < 1): logger.error('All weights must be greater or equal to 1') From b0fa48b4c1f3d0cf3534aac1c2a1fdc08ef41da8 Mon Sep 17 00:00:00 2001 From: Sara Bosticardo Date: Fri, 3 Oct 2025 14:52:04 +0200 Subject: [PATCH 2/3] iso voxels check --- commit/core.pyx | 1 + 1 file changed, 1 insertion(+) diff --git a/commit/core.pyx b/commit/core.pyx index 011520a..e0754ed 100644 --- a/commit/core.pyx +++ b/commit/core.pyx @@ -827,6 +827,7 @@ cdef class Evaluation : # compute array of weights from image array_weights = weights_img[ self.DICTIONARY['MASK_ix'], self.DICTIONARY['MASK_iy'], self.DICTIONARY['MASK_iz'] ].flatten().astype(np.float32) + array_weights = array_weights[self.DICTIONARY['ISO']['vox']] if array_weights.size != self.DICTIONARY['ISO']['n']: logger.error( 'Number of voxels in the weights image does not match the number of voxels in the dictionary' ) if np.any(array_weights < 1): From 90923f91e6c8128f3fbd4bb87aa035f92584e707 Mon Sep 17 00:00:00 2001 From: Sara Bosticardo Date: Mon, 6 Oct 2025 12:08:42 +0200 Subject: [PATCH 3/3] update toml and changelog --- CHANGELOG.md | 9 +++++++++ pyproject.toml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb8ce0c..9b0e53f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ # Change Log ### All notable changes to `COMMIT` will be documented in this file. +## `v2.4.2`
_2025-10-06_ + +### 🐛Fixed +- Error when checking the number of streamlines in the weighted LASSO function +- Error in verifying voxel correspondence between the lesion mask passed through the dictionary and the ISO weights map + +--- +--- + ## `v2.4.1`
_2025-09-18_ ### 🛠️Changed diff --git a/pyproject.toml b/pyproject.toml index d5c89d3..7741a0d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta" [project] name = "dmri-commit" -version = "2.4.1" +version = "2.4.2" dependencies = [ "dmri-amico>=2.0.1", "dmri-dicelib>=1.1.0",