-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from LoicDorval/ld_changes
Ld changes
- Loading branch information
Showing
6 changed files
with
113 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ | |
|
||
from .hist import hist_matching | ||
from .minmax import minmax_matching | ||
from .from_mean import from_mean_matching |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# -*- coding: utf-8 -*- | ||
########################################################################## | ||
# NSAp - Copyright (C) CEA, 2023 | ||
# Distributed under the terms of the CeCILL-B license, as published by | ||
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to | ||
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html | ||
# for details. | ||
########################################################################## | ||
|
||
""" | ||
From mean send by Newcastle Team matching. | ||
""" | ||
|
||
# Imports | ||
import numpy as np | ||
|
||
|
||
def from_mean_matching(source, ref_val, concentration=2.): | ||
""" Adjust the pixel values of a grayscale image. | ||
Parameters | ||
---------- | ||
source: np.ndarray | ||
the image to transform. | ||
ref_val: int | ||
reference value of phantom intensity for the corresponding site. | ||
concentration: float, default 2. | ||
the compartment concentration in milli mols / litre. | ||
Returns | ||
------- | ||
matched: np.ndarray | ||
the transformed source image. | ||
""" | ||
# Normalize data | ||
matched = (source * concentration) / ref_val | ||
return matched |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters