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

Merge of PRESTUS feature updates #34

Open
wants to merge 56 commits into
base: master
Choose a base branch
from

Conversation

jkosciessa
Copy link
Contributor

@jkosciessa jkosciessa commented May 27, 2024

Hi all,

I have merged previous changes in the DI master branch (i.e., @KTZ228's changes) and @eleonoracarpino's open pull request into my recent version.

This includes small feature updates:

  • calculation and plotting of CEM43 heating values (@sirmrmarty)
  • required external tools (e.g., kWave) are included as submodules; this may have consequences for binary downloads (?)

I have also merged @eleonoracarpino's pseudoCT branch. Despite rebasing that branch, this turned out messier than I hoped, so I had to manually redo some recent changes.

I am currently testing this full merge, and will also try out the pseudoCT implementation. If I run into hiccups, I will update this pull request.

It would be great if someone else can also validate this version prior to a merge.

@jkosciessa
Copy link
Contributor Author

Commit f14f5e0 integrated the three parts of the pseudoCT code into a continuous function with relative paths etc.

Successfully ran this with a Donders 2deg UTE image. All fixed parameters, so no dependencies (beyond software toolboxes). Added an example call script as part of the documentation.

@mekman mekman self-assigned this May 30, 2024
@mekman
Copy link
Collaborator

mekman commented May 30, 2024

@jkosciessa do you agree that I can add the .Rhistory to .gitignore bc we don't need it, right?

@jkosciessa
Copy link
Contributor Author

Yes, but let's first delete it, otherwise it will remain in the repo forever. Taking care of it now.

additional paths are expected to be specified as individual cell strings
if not a git repo it will simply show "fatal: not a git repository (or any of the parent directories): .git"
The prior version did not specify how to include additional subtoolboxes. This is now specified, and results in separable cell trings that will be added at the onset of single_subject_pipeline. The assert function easily threw errors when some (usually hardcoded) specs such as paths were inconsistent. Now it throws an interactive warning instead. The MATLAB version check has been moved to the load_parameters check, and similarly throws an interactive warning instead of an error (e.g., acoustic sim seems to run fine also with R2019b).
axis function in MATLAB changed with R2022a
Now uses consistent variable naming in single_subject_pipeline that caused crashes. Mask expansion was previously not applied to pseudoCT, which led to inconsistent image dimensions.
Donders-Institute#40

Tissue parameters and transducer specifications previously mixed 250 and 500 kHz parameters.
This commit integrated smooth_and crop.m and setup_medium.m across setup variants to harmonise how tissues are labeled. All previously hardcoded tissue labels are now referring to the config. The medium mask output of pseudo-CT generation has been reindexed according to the default layered setup and the conversion to tissue mask labels is performed in smooth_and_crop.m similar to the original layered setup. Minor documentation additions. Function getidx.m has been added to rapidly grab tissue labels from the parameters structure.
@jkosciessa
Copy link
Contributor Author

jkosciessa commented Jun 11, 2024

3195d93 is a big one.

As specified in the commit:

This commit integrated smooth_and crop.m and setup_medium.m across setup variants to harmonise how tissues are labeled. All previously hardcoded tissue labels are now referring to the config. The medium mask output of pseudo-CT generation has been reindexed according to the default layered setup and the conversion to tissue mask labels is performed in smooth_and_crop.m similar to the original layered setup. Minor documentation additions. Function getidx.m has been added to rapidly grab tissue labels from the parameters structure.

I forgot a few things in there:

  • Now all figures up to simulation onset should be consistently saved via saveas with individual figure handles. This should avoid any saved figures with grey background.
  • In addition to pseudoCT, smooth_and crop.m now also handles the scenario of a skull-only setup, removing the need for an independent function.

I do not expect any backcompat issues, but given that changes relate to the tissue mapping, it would be good to inspect the outputs in the debug folder that will be created when running the pipeline, in particular checking the coherences ofsound_speed.nii.gz and density.nii.gz with the specified values.

I am currently running both layered and layered+pCT variants. Up to simulation onset, the medium properties looks correct. Acoustic and heating outputs are also in expected ranges.

Each time we run a simulation, the `parameter` file gets added to the output. The current naming is time-dependent to avoid overwrites, but in the case of running multiple simulations with varying parameters (e.g., intensities) in the same folder, it is not too helpful, e.g., `sub-001_parameters_11_06_2024_163206_990.mat`. Now the suffix (which usually specifies the setup) is included and timing info is sparsened.
move example calls out of function directory, dynamically code path separator
Medium properties are most informative for varied tissue types. They do not change for an individual, such that it may not require us to append a suffix that specifies targets , stimulation parameters etc.. However, they could previously get overwritten if a water simulation was run posthoc. This should ensure this does not happen.
@jkosciessa jkosciessa mentioned this pull request Jun 14, 2024
sirmrmarty and others added 3 commits June 27, 2024 12:01
Try to fix part of issue Donders-Institute#40 (for layered solution); save estimated attenuation coefficients as debug output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants