Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nilearn-style reporting (Issue #341) #342

Merged
merged 30 commits into from
Mar 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
52c4ebf
Initial commit: nilearn-style reporting
man-shu Jan 12, 2021
987331f
FIX: minor fixes.
man-shu Jan 15, 2021
d651b68
UPDATE: Independent new reporting.
man-shu Jan 18, 2021
9a6c29f
Minor fixes
man-shu Jan 20, 2021
38fc05f
Minor fixes.
man-shu Jan 20, 2021
e1afdad
FIX: Circular dependencies
man-shu Jan 20, 2021
4c018b8
ADD: Log reporting and modular reports for each step.
man-shu Jan 28, 2021
c31ab49
FIX: log links and heavy final reports
man-shu Feb 7, 2021
d96057f
ADD: real-time update
man-shu Feb 7, 2021
da3621c
FIX: Circle CI errors for old reporting tests
man-shu Feb 8, 2021
f9d21ba
FIX(?): Travis CI
man-shu Feb 8, 2021
e68d1e5
FIX(?): Travis CI
man-shu Feb 8, 2021
2c8dfac
ADD: improved aesthetics and information in new reports
man-shu Feb 19, 2021
d1fd620
ADD: sample new reports
man-shu Feb 19, 2021
9378e0d
FIX: Bertrand's review comments
man-shu Feb 23, 2021
3410b0d
FIX: cut-off tsdiffana y-axis labels
man-shu Feb 23, 2021
be6201b
FIX: Nicolas's travis fixes
man-shu Feb 23, 2021
8672b78
FIX: back to latest scipy version
man-shu Feb 23, 2021
15a2c78
minor fix
man-shu Feb 23, 2021
d4a2e7b
highlight sub-sections
man-shu Mar 12, 2021
fe7870d
Old reporting removal: cleaned subject_data.py
man-shu Mar 13, 2021
5bc6fca
Old reporting removal: deleted main modules and implementation
man-shu Mar 13, 2021
6558dcb
Old reporting removal: deleted html templates and stylesheets
man-shu Mar 13, 2021
7f923d8
Old reporting removal: vars renamed to fix CI
man-shu Mar 15, 2021
1a78c20
debugging dependencies
man-shu Mar 15, 2021
65fe747
debugging previous commit
man-shu Mar 15, 2021
6f94ebb
Old reporting removal: removed glm_reporter (done)
man-shu Mar 16, 2021
9854777
some docstrings
man-shu Mar 21, 2021
e783bcc
Resolved Bertrand's comments
man-shu Mar 23, 2021
9238de7
html index linking to subject reports
man-shu Mar 23, 2021
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
1 change: 0 additions & 1 deletion examples/easy_start/nipype_preproc_spm_auditory.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import nibabel
from pypreprocess.nipype_preproc_spm_utils import do_subjects_preproc
from pypreprocess.datasets import fetch_spm_auditory
from pypreprocess.reporting.glm_reporter import generate_subject_stats_report
import pandas as pd
from nilearn.glm.first_level.design_matrix import (make_first_level_design_matrix,
check_design_matrix)
Expand Down
2 changes: 0 additions & 2 deletions examples/pipelining/nipype_preproc_spm_multimodal_faces.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

# pypreprocess imports
from pypreprocess.datasets import fetch_spm_multimodal_fmri
from pypreprocess.reporting.base_reporter import ProgressReport
from pypreprocess.reporting.glm_reporter import generate_subject_stats_report
from pypreprocess.nipype_preproc_spm_utils import do_subject_preproc
from pypreprocess.subject_data import SubjectData

Expand Down
2 changes: 0 additions & 2 deletions examples/pipelining/nistats_glm_fsl_feeds_fmri.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import time
from pypreprocess.nipype_preproc_spm_utils import (SubjectData,
do_subjects_preproc)
from pypreprocess.reporting.glm_reporter import generate_subject_stats_report
from pypreprocess.reporting.base_reporter import ProgressReport
from pypreprocess.datasets import fetch_fsl_feeds
from pypreprocess.io_utils import compute_mean_3D_image

Expand Down
7 changes: 1 addition & 6 deletions pypreprocess/conf_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,4 @@ def _ignore_subject(subject_id):
return subjects, preproc_params

# this pseudo is better
import_data = _generate_preproc_pipeline


if __name__ == '__main__':
from pypreprocess.reporting.base_reporter import dict_to_html_ul
print(dict_to_html_ul(_parse_job("job.conf")))
import_data = _generate_preproc_pipeline
4 changes: 4 additions & 0 deletions pypreprocess/coreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ def compute_similarity_from_jhist(jh, fwhm=None, cost_fun='nmi'):
krn1 = centered_smoothing_kernel(fwhm[0],
np.linspace(-1 * lim[0], lim[0],
num=2 * lim[0]))
# Pad with zero to get odd length
krn1 = np.append(krn1, 0)
krn1 = krn1 / np.sum(krn1)
krn2 = centered_smoothing_kernel(fwhm[1],
np.linspace(-1 * lim[1], lim[1],
num=2 * lim[1]))
# Pad with zero to get odd length
krn2 = np.append(krn2, 0)
krn2 = krn2 / np.sum(krn2)

# smooth the histogram with kern1 x kern2
Expand Down
5 changes: 3 additions & 2 deletions pypreprocess/external/tempita/_tempita.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def foo(bar):
import re
import sys
import cgi
from html import escape
try:
from urllib import quote as url_quote
except ImportError: # Py3
Expand Down Expand Up @@ -440,10 +441,10 @@ def html_quote(value, force=True):
if not isinstance(value, basestring_):
value = coerce_text(value)
if sys.version >= "3" and isinstance(value, bytes):
value = cgi.escape(value.decode('latin1'), 1)
value = escape(value.decode('latin1'), 1)
value = value.encode('latin1')
else:
value = cgi.escape(value, 1)
value = escape(value, 1)
if sys.version < "3":
if is_unicode(value):
value = value.encode('ascii', 'xmlcharrefreplace')
Expand Down
6 changes: 5 additions & 1 deletion pypreprocess/io_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,11 @@ def is_3D(image):
"""Check whether image is 3D"""

if isinstance(image, str):
image = nibabel.load(image)
if os.path.exists(image):
image = nibabel.load(image)
else:
raise FileNotFoundError("File {} not found.".format(
image))
elif isinstance(image, list):
image = nibabel.concat_images(image,
check_affines=False
Expand Down
Loading