Skip to content

Commit

Permalink
Merge pull request #56 from abhicodes369/created_repostatus/statistics
Browse files Browse the repository at this point in the history
report on repo
  • Loading branch information
etpeterson authored Apr 17, 2024
2 parents 2c3787e + e17a3e7 commit a6b225d
Show file tree
Hide file tree
Showing 5 changed files with 234 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ md5sums.txt
.cache
nosetests.xml
coverage.xml
*.pyc
*.pyc
40 changes: 20 additions & 20 deletions doc/code_contributions_record.csv
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Technique,Category,Subcategory,notes,subfolder,Link to source code,Authors,Institution,function/module,DOI,Tester,test status
IVIM,Fitting,LSQ fitting,,OGC_AmsterdamUMC,TF2.4_IVIM-MRI_CodeCollection/src/original/OGC_AmsterdamUMC/,Oliver Gurney-Champion,Amsterdam UMC,fit_least_squares/fit_least_squares_array,,tbd,
IVIM,Fitting,segmented LSQ fitting,,OGC_AmsterdamUMC,TF2.4_IVIM-MRI_CodeCollection/src/original/OGC_AmsterdamUMC/,Oliver Gurney-Champion,Amsterdam UMC,fit_segmented/fit_segmented_array,,tbd,
Tri-exponential,Fitting,LSQ fitting,,OGC_AmsterdamUMC,TF2.4_IVIM-MRI_CodeCollection/src/original/OGC_AmsterdamUMC/,Oliver Gurney-Champion,Amsterdam UMC,fit_least_squares_tri_exp/fit_least_squares_array_tri_exp,,tbd,
Tri-exponential,Fitting,Segmented LSQ fitting,,OGC_AmsterdamUMC,TF2.4_IVIM-MRI_CodeCollection/src/original/OGC_AmsterdamUMC/,Oliver Gurney-Champion,Amsterdam UMC,fit_segmented_tri_exp/fit_segmented_array_tri_exp,https://doi.org/10.3389/fphys.2022.942495,tbd,
IVIM,Fitting,Bayesian,,OGC_AmsterdamUMC,TF2.4_IVIM-MRI_CodeCollection/src/original/OGC_AmsterdamUMC/,Oliver Gurney-Champion/Sebastiano Barbieri,Amsterdam UMC,fit_bayesian_array,https://doi.org/10.1002/mrm.28852,tbd,
IVIM,Fitting,two-step segmented fit approach,also includes ADC calculation as a separate function,PvH_KB_NKI,TF2.4_IVIM-MRI_CodeCollection/src/original/PvH_KB_NKI/,Petra van Houdt/Stefan Zijlema/Koen Baas,the Netherlands Cancer Institute,DWI_functions_standalone.py,https://doi.org/10.3389/fonc.2021.705964,tbd,
IVIM,Fitting,two-step (segmented) LSQ fitting, cut-off chosen for brain data; option to fit IVIM with inversion recovery or without IR,PV_MUMC,TF2.4_IVIM-MRI_CodeCollection/src/original/PV_MUMC/,Paulien Voorter,Maastricht University Medical Center,two_step_IVIM_fit.py,,tbd,
IVIM,Fitting,bi-exponential NLLS,Supports units in mm2/s and µm2/ms,IAR_LundUniversity,TF2.4_IVIM-MRI_CodeCollection/src/original/IAR_LundUniversity/ivim_fit_method_biexp.py,Ivan A. Rashid,Lund University,IvimModelBiexp,tba,tbd,
IVIM,Fitting,2-step segmented NLLS,First estimates and fixes D before a bi-exponential NLLS fit. Supports units in mm2/s and µm2/ms,IAR_LundUniversity,TF2.4_IVIM-MRI_CodeCollection/src/original/IAR_LundUniversity/ivim_fit_method_segmented_2step.py,Ivan A. Rashid,Lund University,IvimModelSegmented2Step,tba,tbd,
IVIM,Fitting,3-step segmented NLLS,First estimates and fixes D followed by an estimate of D* followed by a bi-exponential NLLS fit. Supports units in mm2/s and µm2/ms,IAR_LundUniversity,TF2.4_IVIM-MRI_CodeCollection/src/original/IAR_LundUniversity/ivim_fit_method_segmented_3step.py,Ivan A. Rashid,Lund University,IvimModelSegmented3Step,tba,tbd,
IVIM,Fitting,2-step segmented NLLS,First estimates and fixes D. Subtracts the diffusion signal and estimated D*. Supports units in mm2/s and µm2/ms,IAR_LundUniversity,TF2.4_IVIM-MRI_CodeCollection/src/original/IAR_LundUniversity/ivim_fit_method_subtracted.py,Ivan A. Rashid,Lund University,IvimModelSubtracted,tba,tbd,
IVIM,Fitting,Variable projection,See referenced article. Supports units in mm2/s and µm2/ms,IAR_LundUniversity,TF2.4_IVIM-MRI_CodeCollection/src/original/IAR_LundUniversity/ivim_fit_method_modified_mix.py,Farooq et al. Modified by Ivan A. Rashid,Lund University,IvimModelVP,https://doi.org/10.1038/srep38927,tbd,
IVIM,Fitting,Variable projection,See referenced article. Supports units in mm2/s and µm2/ms,IAR_LundUniversity,TF2.4_IVIM-MRI_CodeCollection/src/original/IAR_LundUniversity/ivim_fit_method_modified_topopro.py,Fadnavis et al. Modified by Ivan A. Rashid,Lund University,IvimModelTopoPro,https://doi.org/10.3389/fnins.2021.779025,tbd,
IVIM,Fitting,Linear fit,Linear fit for D with extrapolation for f. Supports units in mm2/s and µm2/ms,IAR_LundUniversity,TF2.4_IVIM-MRI_CodeCollection/src/original/IAR_LundUniversity/ivim_fit_method_modified_linear.py,Modified by Ivan A. Rashid,Lund University,IvimModelLinear,tba,tbd,
IVIM,Fitting,sIVIM fit,NLLS of the simplified IVIM model (sIVIM). Supports units in mm2/s and µm2/ms,IAR_LundUniversity,TF2.4_IVIM-MRI_CodeCollection/src/original/IAR_LundUniversity/ivim_fit_method_modified_sivim.py,Modified by Ivan A. Rashid,Lund University,IvimModelsIVIM,tba,tbd,
IVIM,Fitting,Segmented NLLS fitting,MATLAB code,OJ_GU,TF2.4_IVIM-MRI_CodeCollection/src/original/OJ_GU/,Oscar Jalnefjord,University of Gothenburg,IVIM_seg,https://doi.org/10.1007/s10334-018-0697-5,tbd,
IVIM,Fitting,Bayesian,MATLAB code,OJ_GU,TF2.4_IVIM-MRI_CodeCollection/src/original/OJ_GU/,Oscar Jalnefjord,University of Gothenburg,IVIM_bayes,https://doi.org/10.1002/mrm.26783,tbd,
IVIM,Fitting,Segmented NLLS fitting,Specifically tailored algorithm for NLLS segmented fitting,OJ_GU,TF2.4_IVIM-MRI_CodeCollection/src/original/OJ_GU/,Oscar Jalnefjord,University of Gothenburg,seg,https://doi.org/10.1007/s10334-018-0697-5,tbd,
IVIM,Fitting,Linear fit,Linear fit for D and D* and f. Intended to be extremely fast but not always accurate,ETP_SRI,TF2.4_IVIM-MRI_CodeCollection/src/original/ETP_SRI/LinearFitting.py,Eric Peterson,SRI International,,,tbd,
Technique,Category,Subcategory,notes,subfolder,Link to source code,Authors,Institution,function/module,DOI,Tester,test status,Wrapped
IVIM,Fitting,LSQ fitting,,OGC_AmsterdamUMC,TF2.4_IVIM-MRI_CodeCollection/src/original/OGC_AmsterdamUMC/,Oliver Gurney-Champion,Amsterdam UMC,fit_least_squares/fit_least_squares_array,,tbd,,
IVIM,Fitting,segmented LSQ fitting,,OGC_AmsterdamUMC,TF2.4_IVIM-MRI_CodeCollection/src/original/OGC_AmsterdamUMC/,Oliver Gurney-Champion,Amsterdam UMC,fit_segmented/fit_segmented_array,,tbd,,OGC_AmsterdamUMC_biexp
Tri-exponential,Fitting,LSQ fitting,,OGC_AmsterdamUMC,TF2.4_IVIM-MRI_CodeCollection/src/original/OGC_AmsterdamUMC/,Oliver Gurney-Champion,Amsterdam UMC,fit_least_squares_tri_exp/fit_least_squares_array_tri_exp,,tbd,,
Tri-exponential,Fitting,Segmented LSQ fitting,,OGC_AmsterdamUMC,TF2.4_IVIM-MRI_CodeCollection/src/original/OGC_AmsterdamUMC/,Oliver Gurney-Champion,Amsterdam UMC,fit_segmented_tri_exp/fit_segmented_array_tri_exp,https://doi.org/10.3389/fphys.2022.942495,tbd,,OGC_AmsterdamUMC_biexp_segmented
IVIM,Fitting,Bayesian,,OGC_AmsterdamUMC,TF2.4_IVIM-MRI_CodeCollection/src/original/OGC_AmsterdamUMC/,Oliver Gurney-Champion/Sebastiano Barbieri,Amsterdam UMC,fit_bayesian_array,https://doi.org/10.1002/mrm.28852,tbd,,OGC_AmsterdamUMC_Bayesian_biexp
IVIM,Fitting,two-step segmented fit approach,also includes ADC calculation as a separate function,PvH_KB_NKI,TF2.4_IVIM-MRI_CodeCollection/src/original/PvH_KB_NKI/,Petra van Houdt/Stefan Zijlema/Koen Baas,the Netherlands Cancer Institute,DWI_functions_standalone.py,https://doi.org/10.3389/fonc.2021.705964,tbd,,PvH_KB_NKI_IVIMfit
IVIM,Fitting,two-step (segmented) LSQ fitting, cut-off chosen for brain data; option to fit IVIM with inversion recovery or without IR,PV_MUMC,TF2.4_IVIM-MRI_CodeCollection/src/original/PV_MUMC/,Paulien Voorter,Maastricht University Medical Center,two_step_IVIM_fit.py,,tbd,,PV_MUMC_biexp
IVIM,Fitting,bi-exponential NLLS,Supports units in mm2/s and µm2/ms,IAR_LundUniversity,TF2.4_IVIM-MRI_CodeCollection/src/original/IAR_LundUniversity/ivim_fit_method_biexp.py,Ivan A. Rashid,Lund University,IvimModelBiexp,tba,tbd,,IAR_LU_biexp
IVIM,Fitting,2-step segmented NLLS,First estimates and fixes D before a bi-exponential NLLS fit. Supports units in mm2/s and µm2/ms,IAR_LundUniversity,TF2.4_IVIM-MRI_CodeCollection/src/original/IAR_LundUniversity/ivim_fit_method_segmented_2step.py,Ivan A. Rashid,Lund University,IvimModelSegmented2Step,tba,tbd,,IAR_LU_segmented_2step
IVIM,Fitting,3-step segmented NLLS,First estimates and fixes D followed by an estimate of D* followed by a bi-exponential NLLS fit. Supports units in mm2/s and µm2/ms,IAR_LundUniversity,TF2.4_IVIM-MRI_CodeCollection/src/original/IAR_LundUniversity/ivim_fit_method_segmented_3step.py,Ivan A. Rashid,Lund University,IvimModelSegmented3Step,tba,tbd,,IAR_LU_segmented_3step
IVIM,Fitting,2-step segmented NLLS,First estimates and fixes D. Subtracts the diffusion signal and estimated D*. Supports units in mm2/s and µm2/ms,IAR_LundUniversity,TF2.4_IVIM-MRI_CodeCollection/src/original/IAR_LundUniversity/ivim_fit_method_subtracted.py,Ivan A. Rashid,Lund University,IvimModelSubtracted,tba,tbd,,IAR_LU_subtracted
IVIM,Fitting,Variable projection,See referenced article. Supports units in mm2/s and µm2/ms,IAR_LundUniversity,TF2.4_IVIM-MRI_CodeCollection/src/original/IAR_LundUniversity/ivim_fit_method_modified_mix.py,Farooq et al. Modified by Ivan A. Rashid,Lund University,IvimModelVP,https://doi.org/10.1038/srep38927,tbd,,IAR_LU_modified_mix
IVIM,Fitting,Variable projection,See referenced article. Supports units in mm2/s and µm2/ms,IAR_LundUniversity,TF2.4_IVIM-MRI_CodeCollection/src/original/IAR_LundUniversity/ivim_fit_method_modified_topopro.py,Fadnavis et al. Modified by Ivan A. Rashid,Lund University,IvimModelTopoPro,https://doi.org/10.3389/fnins.2021.779025,tbd,,IAR_LU_modified_topopro
IVIM,Fitting,Linear fit,Linear fit for D with extrapolation for f. Supports units in mm2/s and µm2/ms,IAR_LundUniversity,TF2.4_IVIM-MRI_CodeCollection/src/original/IAR_LundUniversity/ivim_fit_method_modified_linear.py,Modified by Ivan A. Rashid,Lund University,IvimModelLinear,tba,tbd,,
IVIM,Fitting,sIVIM fit,NLLS of the simplified IVIM model (sIVIM). Supports units in mm2/s and µm2/ms,IAR_LundUniversity,TF2.4_IVIM-MRI_CodeCollection/src/original/IAR_LundUniversity/ivim_fit_method_modified_sivim.py,Modified by Ivan A. Rashid,Lund University,IvimModelsIVIM,tba,tbd,,
IVIM,Fitting,Segmented NLLS fitting,MATLAB code,OJ_GU,TF2.4_IVIM-MRI_CodeCollection/src/original/OJ_GU/,Oscar Jalnefjord,University of Gothenburg,IVIM_seg,https://doi.org/10.1007/s10334-018-0697-5,tbd,,OJ_GU_seg
IVIM,Fitting,Bayesian,MATLAB code,OJ_GU,TF2.4_IVIM-MRI_CodeCollection/src/original/OJ_GU/,Oscar Jalnefjord,University of Gothenburg,IVIM_bayes,https://doi.org/10.1002/mrm.26783,tbd,,
IVIM,Fitting,Segmented NLLS fitting,Specifically tailored algorithm for NLLS segmented fitting,OJ_GU,TF2.4_IVIM-MRI_CodeCollection/src/original/OJ_GU/,Oscar Jalnefjord,University of Gothenburg,seg,https://doi.org/10.1007/s10334-018-0697-5,tbd,,
IVIM,Fitting,Linear fit,Linear fit for D and D* and f. Intended to be extremely fast but not always accurate,ETP_SRI,TF2.4_IVIM-MRI_CodeCollection/src/original/ETP_SRI/LinearFitting.py,Eric Peterson,SRI International,,,tbd,,ETP_SRI_LinearFitting
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ cvxpy
zenodo-get
pytest
tqdm
pandas
sphinx
sphinx_rtd_theme
66 changes: 66 additions & 0 deletions utilities/repostatus.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import os
import pandas as pd
import json

# directory of the current script
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))

# path to the repository
REPO_DIR = os.path.dirname(SCRIPT_DIR)

CODE_CONTRIBUTIONS_FILE = os.path.join(REPO_DIR, "doc", "code_contributions_record.csv")
ALGORITHMS_FILE = os.path.join(REPO_DIR, "tests", "IVIMmodels", "unit_tests", "algorithms.json")
SOURCE_FOLDER = os.path.join(REPO_DIR, "src", "original")
WRAPPED_FOLDER = os.path.join(REPO_DIR, "src", "standardized")

def generate_html():
"""
Generates an HTML report based on the code contributions and algorithm information.
The report includes the following columns:
- Technique
- Subfolder
- Contributors
- Wrapped
- Tested
The report is saved as 'combined_report.html' in the 'website' directory of the repository.
"""
# Read the CSV file
df = pd.read_csv(CODE_CONTRIBUTIONS_FILE)

unique_subfolders = df['subfolder'].unique().tolist()

# Read the JSON file
with open(ALGORITHMS_FILE, 'r') as f:
algorithms_data = json.load(f)

# list of all algorithms from the JSON file
all_algorithms = algorithms_data['algorithms']

# Check if both code_contributions_file matches with source folder
for subfolder in unique_subfolders:
subfolder_path = os.path.join(SOURCE_FOLDER, subfolder)
if not os.path.exists(subfolder_path):
print(f"Warning: Subfolder '{subfolder}' does not exist in the source folder.")

# Add column 'Tested' to the DataFrame based on a match with algorithms and wrapped column
df['Wrapped'] = df['Wrapped'].fillna('')
df['Tested'] = df.apply(lambda row: 'Yes' if any(algorithm in row['Wrapped'] for algorithm in all_algorithms) else '', axis=1)

# Select the desired columns
df_selected = df[['Technique', 'subfolder', 'Authors', 'Wrapped', 'Tested']]
df_selected.columns = ['Technique', 'Subfolder', 'Contributors', 'Wrapped', 'Tested']

# Convert the DataFrame to HTML
html_string = df_selected.to_html(index=False)

# Save the HTML to a file
with open(os.path.join(REPO_DIR, 'website', 'combined_report.html'), 'w') as f:
f.write(html_string)

# Printing message that report has been successfully generated
print("Combined HTML report generated successfully.")

if __name__ == "__main__":
generate_html()
146 changes: 146 additions & 0 deletions website/combined_report.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th>Technique</th>
<th>Subfolder</th>
<th>Contributors</th>
<th>Wrapped</th>
<th>Tested</th>
</tr>
</thead>
<tbody>
<tr>
<td>IVIM</td>
<td>OGC_AmsterdamUMC</td>
<td>Oliver Gurney-Champion</td>
<td></td>
<td></td>
</tr>
<tr>
<td>IVIM</td>
<td>OGC_AmsterdamUMC</td>
<td>Oliver Gurney-Champion</td>
<td>OGC_AmsterdamUMC_biexp</td>
<td>Yes</td>
</tr>
<tr>
<td>Tri-exponential</td>
<td>OGC_AmsterdamUMC</td>
<td>Oliver Gurney-Champion</td>
<td></td>
<td></td>
</tr>
<tr>
<td>Tri-exponential</td>
<td>OGC_AmsterdamUMC</td>
<td>Oliver Gurney-Champion</td>
<td>OGC_AmsterdamUMC_biexp_segmented</td>
<td>Yes</td>
</tr>
<tr>
<td>IVIM</td>
<td>OGC_AmsterdamUMC</td>
<td>Oliver Gurney-Champion/Sebastiano Barbieri</td>
<td>OGC_AmsterdamUMC_Bayesian_biexp</td>
<td>Yes</td>
</tr>
<tr>
<td>IVIM</td>
<td>PvH_KB_NKI</td>
<td>Petra van Houdt/Stefan Zijlema/Koen Baas</td>
<td>PvH_KB_NKI_IVIMfit</td>
<td>Yes</td>
</tr>
<tr>
<td>IVIM</td>
<td>PV_MUMC</td>
<td>Paulien Voorter</td>
<td>PV_MUMC_biexp</td>
<td>Yes</td>
</tr>
<tr>
<td>IVIM</td>
<td>IAR_LundUniversity</td>
<td>Ivan A. Rashid</td>
<td>IAR_LU_biexp</td>
<td>Yes</td>
</tr>
<tr>
<td>IVIM</td>
<td>IAR_LundUniversity</td>
<td>Ivan A. Rashid</td>
<td>IAR_LU_segmented_2step</td>
<td>Yes</td>
</tr>
<tr>
<td>IVIM</td>
<td>IAR_LundUniversity</td>
<td>Ivan A. Rashid</td>
<td>IAR_LU_segmented_3step</td>
<td>Yes</td>
</tr>
<tr>
<td>IVIM</td>
<td>IAR_LundUniversity</td>
<td>Ivan A. Rashid</td>
<td>IAR_LU_subtracted</td>
<td>Yes</td>
</tr>
<tr>
<td>IVIM</td>
<td>IAR_LundUniversity</td>
<td>Farooq et al. Modified by Ivan A. Rashid</td>
<td>IAR_LU_modified_mix</td>
<td>Yes</td>
</tr>
<tr>
<td>IVIM</td>
<td>IAR_LundUniversity</td>
<td>Fadnavis et al. Modified by Ivan A. Rashid</td>
<td>IAR_LU_modified_topopro</td>
<td>Yes</td>
</tr>
<tr>
<td>IVIM</td>
<td>IAR_LundUniversity</td>
<td>Modified by Ivan A. Rashid</td>
<td></td>
<td></td>
</tr>
<tr>
<td>IVIM</td>
<td>IAR_LundUniversity</td>
<td>Modified by Ivan A. Rashid</td>
<td></td>
<td></td>
</tr>
<tr>
<td>IVIM</td>
<td>OJ_GU</td>
<td>Oscar Jalnefjord</td>
<td>OJ_GU_seg</td>
<td></td>
</tr>
<tr>
<td>IVIM</td>
<td>OJ_GU</td>
<td>Oscar Jalnefjord</td>
<td></td>
<td></td>
</tr>
<tr>
<td>IVIM</td>
<td>OJ_GU</td>
<td>Oscar Jalnefjord</td>
<td></td>
<td></td>
</tr>
<tr>
<td>IVIM</td>
<td>ETP_SRI</td>
<td>Eric Peterson</td>
<td>ETP_SRI_LinearFitting</td>
<td>Yes</td>
</tr>
</tbody>
</table>

0 comments on commit a6b225d

Please sign in to comment.