Skip to content

Commit

Permalink
add scenario1 as yaml.
Browse files Browse the repository at this point in the history
  • Loading branch information
paquiteau committed Nov 24, 2023
1 parent 09bd6f2 commit bda6d81
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/conf/reconstructors/zero_filled.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- adjoint: {}
adjoint: {}
13 changes: 8 additions & 5 deletions src/conf/experiments/scenario1.yaml → src/conf/scenario1.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @package _global
#
# This files contains the configuration to reproduce the scenario 1 of the Simfmri paper.

force_sim: false

simulation:
sim_params:
sim_tr: 0.1
Expand All @@ -14,7 +14,7 @@ simulation:
handlers:
phantom-brainweb:
subject_id: 5
bbox: [0.225,-0.07, 0.06, -0.055, None, None]
bbox: [0.225,-0.07, 0.06, -0.055, null, null]
activation-block:
event_name: block_on
block_on: 20
Expand All @@ -25,15 +25,18 @@ simulation:
snr: 100
acquisition-vds:
shot_time_ms: 50
acs: 0.125
acs: 1
accel: 1
accel_axis: 1
accel_axis: 0
constant: true
direction: top-down
smaps: false

reconstructors:
adjoint: {}

stats:
contrast_name: block_on


hydra:
Expand Down
4 changes: 2 additions & 2 deletions src/simfmri/analysis/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def contrast_zscore(
drift_model=sim.extra_infos.get("drift_model", None),
)
# Create a mask from reference data (not ideal, but best)
mask = sim.data_ref[0] > 0
image_ = abs(image)[:, mask]
mask = sim.static_vol > 0
image_ = abs(image)[..., mask].squeeze()
logger.debug(f"image_={image_.shape}, design matrix={design_matrix.shape}")
labels, results = run_glm(image_, design_matrix.values)
# Translate formulas to vectors
Expand Down
1 change: 1 addition & 0 deletions src/simfmri/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def main_app(cfg: DictConfig) -> None:
simulator, sim = HandlerChain.from_conf(cfg.simulation)
sim = simulator(sim)
del simulator
os.makedirs(cache_dir, exist_ok=True)
with open(sim_file, "wb") as f:
pickle.dump(sim, f)

Expand Down

0 comments on commit bda6d81

Please sign in to comment.