Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
194 commits
Select commit Hold shift + click to select a range
79173ff
Initial plan
Copilot Jul 5, 2025
0ee896a
Comprehensive documentation review and improvements
Copilot Aug 1, 2025
73720e0
WIP: Add download_brain_atlas function to download Cucaracha models f…
acsenrafilho Jun 13, 2025
80ae6c8
ENH: Add antspyx and kagglehub dependencies to pyproject.toml
acsenrafilho Jun 13, 2025
487b97a
WIP: Add Brain Atlas data structure and methods for atlas management
acsenrafilho Jun 13, 2025
c8289ea
ENH: Create __init__.py for asltk.data package initialization
acsenrafilho Jun 13, 2025
30cb4b0
WIP: Implement brain normalization function for image registration us…
acsenrafilho Jun 13, 2025
ae15930
Implement code changes to enhance functionality and improve performance
acsenrafilho Jun 13, 2025
333c6a3
ENH: Refactor BrainAtlas class to remove hardcoded atlas data and imp…
acsenrafilho Jun 14, 2025
05ec773
ENH: Add multiple brain atlas JSON files with metadata and descriptions
acsenrafilho Jun 14, 2025
5190b3a
ENH: Add multiple brain atlas JSON files with metadata and descriptions
acsenrafilho Jun 14, 2025
c7d81f4
ENH: Add unit tests for BrainAtlas class to validate atlas listing an…
acsenrafilho Jun 14, 2025
eb325bc
STY: Clean up whitespace and ensure consistent formatting in download…
acsenrafilho Jun 14, 2025
77898b9
ENH: Remove unused kaggle_tools.py file and associated download_brain…
acsenrafilho Jun 17, 2025
85e90ab
ENH: Update MNI2009.json to include dataset URL and detailed labels f…
acsenrafilho Jun 17, 2025
bc9612a
ENH: Refactor BrainAtlas class to improve atlas loading and error han…
acsenrafilho Jun 17, 2025
274e7ff
ENH: Refactor brain normalization function to space normalization, im…
acsenrafilho Jun 17, 2025
cc60e04
ENH: Add comprehensive tests for rigid body registration and head mov…
acsenrafilho Jun 17, 2025
24b11cc
ENH: Add data.brain_atlas reference to documentation and include it i…
acsenrafilho Jun 17, 2025
5400c1b
ENH: Add initial test suite for registration module
acsenrafilho Jun 17, 2025
65cd710
ENH: Implement space normalization function and head movement correct…
acsenrafilho Jun 17, 2025
e44235b
ENH: Refactor registration tests to improve error handling and add co…
acsenrafilho Jun 17, 2025
429e783
ENH: Add tests for head movement correction function, including succe…
acsenrafilho Jun 17, 2025
fdaf5ea
ENH: Add tests for error handling in setting atlas and retrieving URL…
acsenrafilho Jun 17, 2025
920a3c2
ENH: Update Python version matrix in CI workflows to include 3.11, 3.…
acsenrafilho Jun 17, 2025
3cbce18
ENH: Improve docstring for head movement correction function to clari…
acsenrafilho Jun 17, 2025
18e974d
ENH: Update code formatting check step in CI workflow to use 'lint_ch…
acsenrafilho Jun 17, 2025
08d873e
ENH: Update CI workflow to use 'lint_check' task for code formatting …
acsenrafilho Jun 17, 2025
16367a4
ENH: Add dataset DOI and citation DOIs to MNI2009 brain atlas JSON
acsenrafilho Jun 17, 2025
f1c951c
ENH: Update Python version matrix in CI workflows to include 3.11, 3.…
acsenrafilho Jun 17, 2025
df4dcd5
ENH: Remove Python 3.13 from version matrix in CI workflows for devel…
acsenrafilho Jun 17, 2025
4cf38c4
ENH: Add workflow_dispatch trigger to CI for develop branch
acsenrafilho Jun 17, 2025
ad09bf1
ENH: Add test for ParcellationReport class to validate report generat…
acsenrafilho Jun 17, 2025
dc49256
ENH: Implement BasicReport and ParcellationReport classes for report …
acsenrafilho Jun 17, 2025
1cb843a
ENH: Update Python version matrix in CI workflows to only include 3.9…
acsenrafilho Jun 17, 2025
a5e79ca
ENH: Add LGPHCC2022 brain atlas JSON file and remove obsolete LGPHCCx…
acsenrafilho Jun 18, 2025
b33d4d0
ENH: Add AICHA2021 brain atlas JSON file and remove obsolete AICHAxxx…
acsenrafilho Jun 18, 2025
3c85c8d
ENH: Add AAL32024 brain atlas JSON file and remove obsolete AAL2015 file
acsenrafilho Jun 18, 2025
d5d859f
ENH: Add additional metadata fields to brain atlas JSON files for CAP…
acsenrafilho Jun 18, 2025
a23a656
ENH: Add JHA2005 brain atlas JSON file and remove obsolete JHAxxxx file
acsenrafilho Jun 18, 2025
2f452ab
ENH: Add FCA7N2011 brain atlas JSON file and remove obsolete FCA7Nxxx…
acsenrafilho Jun 18, 2025
f4bef32
ENH: Update AAT2022 brain atlas JSON file with dataset URL, DOI, and …
acsenrafilho Jun 18, 2025
5eacc0e
ENH: Update HOCSA2006 brain atlas JSON file with dataset URL, DOI, an…
acsenrafilho Jun 18, 2025
5bc17b8
ENH: Update description in MA2012 brain atlas JSON file for clarity
acsenrafilho Jun 18, 2025
39848ad
STY: fix linter
acsenrafilho Jun 18, 2025
d1a6e94
WIP: Parcellation Report partial implementation
acsenrafilho Jun 18, 2025
efa7bf7
ENH: Remove deprecated brain atlas JSON files and add updated version…
acsenrafilho Jun 18, 2025
faf5edd
STY: Fix linter
acsenrafilho Jun 18, 2025
69660c1
STY: Fix linter and isort
acsenrafilho Jun 18, 2025
dd454c0
BUG: Correct JSON formatting in HOCSA2006 brain atlas file
acsenrafilho Jun 18, 2025
72e2c71
ENH: Add unit tests for BrainAtlas class functionality
acsenrafilho Jun 18, 2025
13e96af
WIP: ParcellationReport tests
acsenrafilho Jun 18, 2025
85ebb7d
BUG: Update mask loading to handle numpy arrays in space_normalizatio…
acsenrafilho Jun 18, 2025
9dde0a8
ENH: Implement ASL data registration with normalization and error han…
acsenrafilho Jun 18, 2025
7179406
WIP: Fix file path for saving regions DataFrame in ParcellationReport
acsenrafilho Jun 18, 2025
8d45c68
ENH: Add tests for asl_template_registration function to validate inp…
acsenrafilho Jun 18, 2025
c0c8ebb
ENH: Implement progress bar for volume registration in asl_template_r…
acsenrafilho Jun 20, 2025
f40763c
ENH: Add tests for apply_transformation function to validate output a…
acsenrafilho Jun 21, 2025
80314e8
WIP: Adjusting asl_template_registration method
acsenrafilho Jun 21, 2025
27fd652
ENH: Add tests for ASLData class to validate copy behavior and length…
acsenrafilho Jun 21, 2025
9418436
ENH: Implement deep copy method for ASLData class and add length calc…
acsenrafilho Jun 21, 2025
ba5152f
STY: Remove outdated TODO comments related to atlas resources and com…
acsenrafilho Jun 21, 2025
fb4bdda
DOC: Add Brain Parcellation Reports module and update navigation in m…
acsenrafilho Jun 21, 2025
2656abe
ENH: Add apply_transformation function to apply a list of transformat…
acsenrafilho Jun 21, 2025
78171fb
ENH: Remove console logging from space_normalization function to stre…
acsenrafilho Jun 21, 2025
b70ee3d
ENH: Refactor asl_template_registration to improve normalization proc…
acsenrafilho Jun 21, 2025
8aa32a1
DOC: Update docstrings in BasicReport class for improved clarity and …
acsenrafilho Jun 21, 2025
4e9f4f1
BUG: Fix linter
acsenrafilho Jun 21, 2025
2fed8ad
ENH: Update lint task name to lint_check in CI workflows for consistency
acsenrafilho Jun 21, 2025
47036e5
BUG: Improve docstring for copy method in ASLData class for clarity
acsenrafilho Jun 21, 2025
9f00d17
ENH: Update pre_test task to use lint_check for consistency in CI wor…
acsenrafilho Jun 21, 2025
92a46b3
WIP: Fixing asl_template_normalization to use M0 volume first
acsenrafilho Jun 23, 2025
b0fd653
BUG: Improve type checks in apply_transformation function for moving …
acsenrafilho Jun 23, 2025
50eed04
ENH: Refactor asl_template_registration to prioritize M0 image for no…
acsenrafilho Jun 23, 2025
c2e4ca0
ENH: Implement tests for asl_template_registration to validate succes…
acsenrafilho Jun 23, 2025
965c6c1
ENH: Add tests for apply_transformation with BrainAtlas reference inp…
acsenrafilho Jun 23, 2025
b81de74
BUG: Update error messages in apply_transformation tests for clarity …
acsenrafilho Jun 25, 2025
5ad0d9a
WIP: commenting asl_template_registration tests for a while
acsenrafilho Jun 25, 2025
267b486
STY: Refactor asl_template_registration for improved readability and …
acsenrafilho Jun 25, 2025
0bb471a
BUG: Fix type checking for reference_image in apply_transformation fu…
acsenrafilho Jun 25, 2025
352362a
ENH: Add pytest-mock dependency for improved testing capabilities
acsenrafilho Jun 25, 2025
e10d62b
ENH: Add tests for BasicReport and ASLData, including error handling …
acsenrafilho Jun 25, 2025
ce607f7
DOC: Update import path for load_image and save_image functions in ge…
acsenrafilho Jun 25, 2025
c307bee
STY: Refactor import paths for load_image and save_image functions; r…
acsenrafilho Jun 25, 2025
4f0b624
ENH: Implement load_image and save_image functions for BIDS directory…
acsenrafilho Jun 25, 2025
6f4f023
STY: Update import path for collect_data_volumes in gaussian.py
acsenrafilho Jun 25, 2025
37c4df0
STY: Add TODO comments for fixing T1 data loading and adjusting Kaggl…
acsenrafilho Jun 25, 2025
31d9b58
REF: Update import paths and replace ants.image_read with load_image …
acsenrafilho Jun 25, 2025
fc5c50a
WIP: New modules to image orientation validation
acsenrafilho Jun 25, 2025
b761f76
ENH: Add unit tests for rigid body registration and head movement cor…
acsenrafilho Jul 2, 2025
dff3e36
STY: Remove commented-out test placeholder for brain mask dimension c…
acsenrafilho Jul 2, 2025
f43d74d
WIP: Implement initial structure for ASLRegistration class with pipel…
acsenrafilho Jul 2, 2025
fc32340
DOC: Add initial Copilot instructions for ASL toolkit usage and guide…
acsenrafilho Jul 4, 2025
b14f83e
ENH: Add VSCode settings for Python testing configuration and commit …
acsenrafilho Jul 4, 2025
1317236
ENH: Improve ASL template registration by normalizing pcasl volumes a…
acsenrafilho Jul 4, 2025
88258e3
Initial plan
Copilot Jul 3, 2025
6c3c749
Add smoothing filter support to reconstruction module
Copilot Jul 3, 2025
d3e9cc8
Initial plan
Copilot Jul 3, 2025
c019b00
Implement comprehensive logging system for ASLTK
Copilot Jul 3, 2025
d50656e
Add comprehensive logging documentation and complete DW ASL script in…
Copilot Jul 3, 2025
baf5dc5
DOC: Add logging documentation to navigation
acsenrafilho Jul 3, 2025
5563dc2
STY: Fix linter
acsenrafilho Jul 3, 2025
bf442e8
ENH: Update pre-test task to use lint-check for improved linting process
acsenrafilho Jul 3, 2025
9b94966
STY: Fix linter
acsenrafilho Jul 3, 2025
fa322f1
BUG: Close and remove logger handlers to prevent file locking on Windows
acsenrafilho Jul 3, 2025
a7b0050
BUG: Improve logging level configuration tests to ensure proper handl…
acsenrafilho Jul 3, 2025
8da4f0e
Initial plan
Copilot Jul 3, 2025
682c23e
Add default options to cbf, te_asl and dw_asl scripts
Copilot Jul 3, 2025
836401b
STY: Fix linter
acsenrafilho Jul 4, 2025
256e82b
ENH: Fix linter and merge conflicts
acsenrafilho Jul 9, 2025
b8a17b1
ENH: Simplify workflow names for CI configurations
acsenrafilho Jul 9, 2025
6295373
BUG: Update lint check task name in CI workflows for consistency
acsenrafilho Jul 9, 2025
0717b53
BUG: Update assertion in test_basic_report_generate_report_abstract_m…
acsenrafilho Jul 9, 2025
50c5875
Bump version to 0.4.0 in pyproject.toml
acsenrafilho Jul 9, 2025
ed94653
ENH: Remove unused parameter from asl_template_registration and delet…
acsenrafilho Jul 11, 2025
2ab5be4
ENH: Remove unused ASLRegistration class and add tests for head movem…
acsenrafilho Jul 11, 2025
333d95c
ENH: Refactor space_normalization function by removing unused paramet…
acsenrafilho Jul 16, 2025
5ec8fd9
DOC: Improve ASLData constructor documentation for clarity and detail
acsenrafilho Jul 16, 2025
7ad6ee6
ENH: Improve image resizing logic and optimize orientation analysis f…
acsenrafilho Jul 16, 2025
946286b
WIP: Update test_space_normalization_success to use actual ASLData pa…
acsenrafilho Jul 16, 2025
4344644
ENH: Add new test files for image manipulation and statistics, includ…
acsenrafilho Jul 28, 2025
d5434ed
ENH: Implement calculate_snr and analyze_image_properties functions f…
acsenrafilho Jul 28, 2025
e73f7f4
ENH: Refactor image property analysis by removing redundant function …
acsenrafilho Jul 28, 2025
b3c5c2a
REF: Refactor smoothing functionality by moving it to aux_methods.py …
acsenrafilho Jul 16, 2025
105df85
REF: Update smoothing function references in CBF, MultiDW, and MultiT…
acsenrafilho Jul 16, 2025
b09d211
Add T2Scalar_ASLMapping to __all__ in __init__.py
acsenrafilho Jul 16, 2025
b0ba261
WIP: Add T2Scalar_ASLMapping initial implementation
acsenrafilho Jul 16, 2025
87507df
Add unit tests for MultiTE and T2Scalar ASL mapping functionalities
acsenrafilho Jul 16, 2025
09fda3f
WIP: Refactor T2Scalar_ASLMapping: streamline initialization, enhance…
acsenrafilho Jul 16, 2025
762f395
Remove unused import of asl_t2_scalar_multi_te from t2_mapping.py
acsenrafilho Jul 16, 2025
121bcd3
Refactor T2Scalar_ASLMapping: improve multiprocessing handling, enhan…
acsenrafilho Jul 17, 2025
d551f0a
TEST: Add tests for handling DW values in ASL data, T2 map retrieval,…
acsenrafilho Jul 18, 2025
9af6cc2
TEST: Add median smoothing tests with default parameters, different s…
acsenrafilho Jul 18, 2025
78e098e
ENH: Refactor T2Scalar_ASLMapping: enhance error handling for TE/PLD …
acsenrafilho Jul 18, 2025
b5ee511
STY: Remove commented TODO regarding LD/PLD size check in CBFMapping.…
acsenrafilho Jul 18, 2025
a9932e8
ENH: Add validation for smoothing_params in _apply_smoothing_to_maps …
acsenrafilho Jul 18, 2025
7e2bf20
DOC: Add Copilot instructions and code commit guidelines
acsenrafilho Jul 18, 2025
08d04a2
DOC: Improve documentation for T2Scalar_ASLMapping class and load_ima…
acsenrafilho Jul 18, 2025
d762d46
ENH: Add T2 Scalar Mapping script with argument parsing and processin…
acsenrafilho Jul 18, 2025
7b9a4fe
ENH: Add T2 Scalar Mapping script documentation and update navigation…
acsenrafilho Jul 18, 2025
485a0da
ENH: Add script entries for ASLTK command line tools in pyproject.toml
acsenrafilho Jul 18, 2025
f0efff4
ENH: Update command usage in documentation and script help for clarity
acsenrafilho Jul 18, 2025
56b265d
ENH: Implement image loading test for M0 using numpy array
acsenrafilho Jul 26, 2025
d84a948
ENH: Add test for creating ASLData object with PCASL as numpy array a…
acsenrafilho Jul 26, 2025
516d7b8
BUG: Support loading ASL image from numpy array in ASLData initializa…
acsenrafilho Jul 26, 2025
21a5f0c
ENH: Improve SNR and mean intensity calculations with ROI support and…
acsenrafilho Jul 30, 2025
51bd58b
ENH: Add tests for calculate_mean_intensity and improve calculate_snr…
acsenrafilho Jul 30, 2025
45bbaf8
ENH: Add reference volume selection functionality with SNR and mean i…
acsenrafilho Jul 30, 2025
5520bc5
DOC: Update copilot instructions with detailed commit message guideli…
acsenrafilho Jul 30, 2025
ed1ea0b
ENH: Rename parameter 'transformation_matrix' to 'transforms' in appl…
acsenrafilho Jul 30, 2025
9f73cc9
ENH: Improve ASLData class by adding warnings for 4D M0 images and av…
acsenrafilho Jul 30, 2025
0544c7f
ENH: Refactor image loading and saving in tests, add error handling f…
acsenrafilho Jul 30, 2025
e7c54a8
ENH: Enhance head movement correction by adding flexible reference vo…
acsenrafilho Jul 30, 2025
e766bb9
ENH: Add select_reference_volume function and corresponding tests for…
acsenrafilho Jul 30, 2025
e5774b5
ENH: Update error message for invalid reference volume and add valida…
acsenrafilho Jul 30, 2025
40436d2
STY: Update import statement for load_image to correct module path
acsenrafilho Jul 30, 2025
1074d37
STY: Update import statement for load_image to correct module path
acsenrafilho Jul 30, 2025
708f8ab
STY: Update import statement for load_image to correct module path
acsenrafilho Jul 30, 2025
e2aa7ad
Add T2Scalar_ASLMapping to __all__ in __init__.py
acsenrafilho Jul 16, 2025
b5fdcd4
Add unit tests for MultiTE and T2Scalar ASL mapping functionalities
acsenrafilho Jul 16, 2025
6052d5c
Refactor T2Scalar_ASLMapping: improve multiprocessing handling, enhan…
acsenrafilho Jul 17, 2025
a4eac45
DOC: Add Copilot instructions and code commit guidelines
acsenrafilho Jul 18, 2025
75fac8e
ENH: Bumpversion v0.5.0
acsenrafilho Jul 18, 2025
5d4db5b
Add T2Scalar_ASLMapping to __all__ in __init__.py
acsenrafilho Jul 16, 2025
3c09e31
Add unit tests for MultiTE and T2Scalar ASL mapping functionalities
acsenrafilho Jul 16, 2025
e4eeb54
Refactor T2Scalar_ASLMapping: improve multiprocessing handling, enhan…
acsenrafilho Jul 17, 2025
0677602
Add T2Scalar_ASLMapping to __all__ in __init__.py
acsenrafilho Jul 16, 2025
63c60f2
WIP: Add T2Scalar_ASLMapping initial implementation
acsenrafilho Jul 16, 2025
3805c8d
Add unit tests for MultiTE and T2Scalar ASL mapping functionalities
acsenrafilho Jul 16, 2025
441afea
WIP: Refactor T2Scalar_ASLMapping: streamline initialization, enhance…
acsenrafilho Jul 16, 2025
fecea2a
Refactor T2Scalar_ASLMapping: improve multiprocessing handling, enhan…
acsenrafilho Jul 17, 2025
e5a282e
Add T2Scalar_ASLMapping to __all__ in __init__.py
acsenrafilho Jul 16, 2025
efdab34
WIP: Add T2Scalar_ASLMapping initial implementation
acsenrafilho Jul 16, 2025
5e0532c
Add unit tests for MultiTE and T2Scalar ASL mapping functionalities
acsenrafilho Jul 16, 2025
50b1d3c
WIP: Refactor T2Scalar_ASLMapping: streamline initialization, enhance…
acsenrafilho Jul 16, 2025
3e9df09
Refactor T2Scalar_ASLMapping: improve multiprocessing handling, enhan…
acsenrafilho Jul 17, 2025
67ce20f
Add T2Scalar_ASLMapping to __all__ in __init__.py
acsenrafilho Jul 16, 2025
cb22bf8
Add unit tests for MultiTE and T2Scalar ASL mapping functionalities
acsenrafilho Jul 16, 2025
1d7a52f
Refactor T2Scalar_ASLMapping: improve multiprocessing handling, enhan…
acsenrafilho Jul 17, 2025
8a8493c
ENH: Implement image loading test for M0 using numpy array
acsenrafilho Jul 26, 2025
b8bf17d
ENH: Add test for creating ASLData object with PCASL as numpy array a…
acsenrafilho Jul 26, 2025
de981b6
ENH: Implement image loading test for M0 using numpy array
acsenrafilho Jul 26, 2025
2f1abc6
ENH: Implement image loading test for M0 using numpy array
acsenrafilho Jul 26, 2025
983ade2
ENH: Implement image loading test for M0 using numpy array
acsenrafilho Jul 26, 2025
e28af49
STY: Fix linter
acsenrafilho Jul 30, 2025
e8257e6
STY: Remove unused import of load_image from asltk.utils
acsenrafilho Jul 30, 2025
b62edf4
DEL: Remove copilot instructions document
acsenrafilho Jul 30, 2025
4aa2e4f
STY: Comment out unused imports and class definitions in report modul…
acsenrafilho Jul 31, 2025
e8dd960
ENH: Update version to 0.6.0 in pyproject.toml
acsenrafilho Jul 31, 2025
470b76a
Enh/bumpversion (#67)
acsenrafilho Aug 13, 2025
edfb279
Develop (#57)
acsenrafilho Jul 31, 2025
ce18cc7
Enh/bumpversion (#67)
acsenrafilho Aug 13, 2025
bc298ab
DOC: Update citation in README and index documentation (#68)
acsenrafilho Aug 13, 2025
ef6fa04
Merge remote-tracking branch 'origin/develop' into copilot/fix-38
acsenrafilho Aug 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions asltk/asldata.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ def __init__(
logger.debug('ASLData object created successfully')

def set_image(self, image, spec: str):
"""Insert a image necessary to define de ASL data processing.
"""Insert an image necessary to define the ASL data processing.

The `spec` parameters specifies what is the type of image to be used in
The `spec` parameter specifies what is the type of image to be used in
ASL processing step. Choose one of the options: `m0` for the M0 volume,
`pcasl` for the pCASL data.

Expand Down Expand Up @@ -333,3 +333,19 @@ def _check_m0_dimension(self):
'This may cause issues in processing. '
'Consider averaging the M0 image across the first dimension.'
)

def _check_m0_dimension(self):
if len(self._m0_image.shape) > 3:
warnings.warn(
'M0 image has more than 3 dimensions. '
'This may cause issues in processing. '
'Consider averaging the M0 image across the first dimension.'
)

def _check_m0_dimension(self):
if len(self._m0_image.shape) > 3:
warnings.warn(
'M0 image has more than 3 dimensions. '
'This may cause issues in processing. '
'Consider averaging the M0 image across the first dimension.'
)
18 changes: 18 additions & 0 deletions asltk/aux_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@


def _check_mask_values(mask, label, ref_shape):
"""Validate mask array for brain mask processing.

This function performs comprehensive validation of brain mask data to ensure
it meets the requirements for ASL processing. It checks data type, binary
format compliance, label presence, and dimensional compatibility.

Args:
mask (np.ndarray): The brain mask image to validate.
label (int or float): The label value to search for in the mask.
ref_shape (tuple): The reference shape that the mask should match.

Raises:
TypeError: If mask is not a numpy array or dimensions don't match.
ValueError: If the specified label value is not found in the mask.

Warnings:
UserWarning: If mask contains more than 2 unique values (not strictly binary).
"""
# Check wheter mask input is an numpy array
if not isinstance(mask, np.ndarray):
raise TypeError(f'mask is not an numpy array. Type {type(mask)}')
Expand Down
32 changes: 30 additions & 2 deletions asltk/models/signal_dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def asl_model_buxton(
It is assumed that the LD and PLD values are coherent with the ASl Buxton
model, i.e. the both has the same array size.

The calculations is given assuming a voxel value. Hence, all the `tau`,
`w`, `cbf` and `att` values must representas a voxel in the image.
The calculations are given assuming a voxel value. Hence, all the `tau`,
`w`, `cbf` and `att` values must represent a voxel in the image.

Note:
The CBF value is the original scale, without assuming the normalized
Expand Down Expand Up @@ -323,6 +323,34 @@ def asl_model_multi_te(
def asl_model_multi_dw(
b_values: list, A1: list, D1: float, A2: list, D2: float
):
"""Multi Diffusion-Weighted (DW) ASL model for diffusion parameter calculation.

This function calculates the multi-compartment diffusion signal for ASL data
with multiple diffusion weighting (b-values). It models the signal decay
using a bi-exponential model with two diffusion compartments.

The model equation used is:
S(b) = A1 * exp(-b * D1) + A2 * exp(-b * D2)

where:
- S(b) is the signal at b-value b
- A1, A2 are the amplitudes for each compartment
- D1, D2 are the diffusion coefficients for each compartment

Args:
b_values (list): List of diffusion b-values (s/mm²).
A1 (list): Amplitude values for the first diffusion compartment.
D1 (float): Diffusion coefficient for the first compartment (mm²/s).
A2 (list): Amplitude values for the second diffusion compartment.
D2 (float): Diffusion coefficient for the second compartment (mm²/s).

Returns:
numpy.ndarray: Array of calculated magnetization values for each b-value.

Note:
In case of numerical overflow or runtime errors during computation,
the affected values are set to 0.0 to maintain array integrity.
"""
mag_total = np.zeros(len(b_values))

for i in range(0, len(b_values)):
Expand Down
4 changes: 2 additions & 2 deletions asltk/smooth/gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
def isotropic_gaussian(data, sigma: float = 1.0):
"""Smooth the data using a isotropic Gaussian kernel.

This method assumes that the same kernal size will be applied over all the
This method assumes that the same kernel size will be applied over all the
volume dimension. The method uses the `SimpleITK` library to apply the
smoothing.

Expand All @@ -21,7 +21,7 @@ def isotropic_gaussian(data, sigma: float = 1.0):
Important:
The kernel size, given by the sigma value, is referred to number of
voxels considered to apply the smoothing. Therefore, when the voxel
resolution is low (tipically for ASL data is around 3-4 mm), the sigma
resolution is low (typically for ASL data is around 3-4 mm), the sigma
value should be around 0.5-2, depending on the desired smoothing effect.

Parameters
Expand Down
Loading