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

Several examples fail because of glm reporter wrong input #318

Open
thomasbazeille opened this issue Mar 7, 2019 · 2 comments
Open

Several examples fail because of glm reporter wrong input #318

thomasbazeille opened this issue Mar 7, 2019 · 2 comments

Comments

@thomasbazeille
Copy link

thomasbazeille commented Mar 7, 2019

The code is simple :

sd = fetch_spm_multimodal_fmri()
sd.output_dir = "/tmp/sub001"
sd.func = [sd.func1, sd.func2]

do_subject_preproc(sd.__dict__, concat=False, coregister=True, stc=True,
                   tsdiffana=True, realign=True, report=True, reslice=True)

But for some reason sd is of the wrong type :

Full Stack Trace:
Traceback (most recent call last):
  File "examples/pure_python/pure_python_preproc_demo.py", line 16, in <module>
    tsdiffana=True, realign=True, report=True, reslice=True)
  File "/home/parietal/tbazeill/pypreprocess/build/py3k/pypreprocess/purepython_preproc_utils.py", line 282, in do_subject_preproc
    n_sessions = len(subject_data.session_ids)
TypeError: object of type 'NoneType' has no len()

More generally, @kchawla-pi is working on cleaning the glm reporter code for nistats especially the types of input needed. Maybe we should wait until he's finished and build on that

@thomasbazeille thomasbazeille changed the title nipype_preproc_spm_auditory.py example fail because of glm reporter wrong input pure_python_preproc_demo.py example fail because of glm reporter wrong input Mar 7, 2019
@thomasbazeille
Copy link
Author

thomasbazeille commented Mar 7, 2019

Another bug related to glm reporter plagues the examples running :

from pypreprocess.reporting.glm_reporter import generate_subject_stats_report

generate_subject_stats_report(
    stats_report_filename,
    contrasts,
    z_maps,
    fmri_glm.masker_.mask_img_,
    design_matrices=[design_matrix],
    subject_id=subject_data.subject_id,
    anat=anat_img,
    display_mode='ortho',
    threshold=3.,
    cluster_th=50,  # 'large' clusters
    start_time=stats_start_time,
    paradigm=paradigm,
    TR=tr,
    nscans=nscans,
    hfcut=hfcut,
    frametimes=frametimes,
    drift_model=drift_model,
    hrf_model=hrf_model)

such as easy_start/easy_start/nipype_preproc_spm_auditory.py
; pipelining/nipype_preproc_spm_multimodal_faces.py or pipelining/nistats_glm_fsl_feeds_fmri.py.

It apparently comes from contrasts/zmaps/design_matrixes input format that has to be carefully chosen, as in : https://github.com/kchawla-pi/nistats/blob/glm-reporter-attempt2/examples/06_glm_reporter/02_first_level_models/report_fiac_analysis.py

A Traceback (most recent call last):
  File "examples/easy_start/nipype_preproc_spm_auditory.py", line 142, in <module>
    hrf_model=hrf_model)
  File "/home/parietal/tbazeill/pypreprocess/build/py3k/pypreprocess/reporting/glm_reporter.py", line 358, in generate_subject_stats_report
    z_threshold=threshold, title=title)
  File "/home/parietal/tbazeill/pypreprocess/build/py3k/pypreprocess/reporting/glm_reporter.py", line 86, in generate_level1_stats_table
    clusters = [c for c in clusters if c['cluster_p_value'] < cluster_pval]
  File "/home/parietal/tbazeill/pypreprocess/build/py3k/pypreprocess/reporting/glm_reporter.py", line 86, in <listcomp>
    clusters = [c for c in clusters if c['cluster_p_value'] < cluster_pval]
TypeError: '<' not supported between instances of 'NoneType' and 'float'

@thomasbazeille thomasbazeille changed the title pure_python_preproc_demo.py example fail because of glm reporter wrong input several example fail because of glm reporter wrong input Mar 7, 2019
@thomasbazeille thomasbazeille changed the title several example fail because of glm reporter wrong input Several examples fail because of glm reporter wrong input Mar 7, 2019
@thomasbazeille
Copy link
Author

Related to #287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant