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

Added a shell script mri2mesh/mri2mesh.sh #96

Conversation

SeSodesa
Copy link
Collaborator

The script calls FreeSurfer via mri2mesh/fs2zef.sh to construct MRI
segmentation ASCII files, which Zeffiro Interface then reads in to
generate a set of finite element meshes.

Also allowed .sh and .zef files in .gitignore. A compilation of
all the individual commit messages this commit consisted of before
squashing are listed below (if the Git message field length allows).


.gitignore: allowed shell (.sh) scripts

Added zef_create_head_model.sh

Currently Zeffiro Interface throws an error when smoothing and
refinement are turned on in the variable ZEF_INPUT_SCRIPT.

zef_create_head_model: deactivated mesh smoothing and refinement

Added multicompartment_head_settings.m

This is to be passed to Zeffiro Interface in zef_create_head_model.sh,
in the input script.

zef_create_head_model: updated Zeffiro input script with multicompartment_head_settings.m

Also quoted paths stored in other variables.

script_zef_create_head_model: started preparing for looping over all subjects in a given directory

Still a few error cases to be handled in the for loop, before one should
dare trying to actually run Matlab.

zef_create_head_model: the script now starts ZI

Need to make sure it still works. Might have to terminate processes
manually when run.

Subject output file messages uncommented

Added files {mri2mesh,fs2zef}.sh to project root

The routine mri2mesh.sh is a rework of the zef_create_head_model.sh,
which also calls fs2zef.sh to create the required text segmentation
files in target subject folders. Currently only this step is implemented
in one form or another, but the intention is to include the mesh
generation in later, once this part is deemed to work.

mri2mesh: automated import script copying to FreeSurfer target folders

Also prettified output and updated comments.

mri2mesh: added paths required for mesh generation

script_zef_create_head_model: added mesh generation line

import_segmentation.zef: removed line with electrodes

Now the relevant data should start on line 56. Header lenght hardcoded
as 55 in Zeffiro.

.gitignore: allowed .zef files

mri2mesh: moved all related files into folder mri2mesh/

Also changed the import script path in mri2mesh.sh to reflect this.
Both fs2zef.sh and import_segmentation.zef are now expected to be
located in the same folder with mri2mesh.sh.

A README with instructions was also added to the folder.

multicompartment_head_settings also moved to mri2mesh/

Deleted zef_create_head_model as unnecessary

The script mri2mesh.sh repaces this.

mri2mesh: added a check for the existence of the MRI2ZEF folder...

... and added the variable ZI_DIR, which is assumed to point to the
parent folder of mri2mesh/.

mri2mesh: temporarily add zefiro_interface/ and mri2mesh/ to Matlab path

mri2mesh: added a check for the existence of zeffiro_interface.m in the supposed Zeffiro Interface folder

The script also now automatically changes the working directory to the
ZI folder and then back to the one where the script was called from,
once it is done running.

The script calls FreeSurfer via `mri2mesh/fs2zef.sh` to construct MRI
segmentation ASCII files, which Zeffiro Interface then reads in to
generate a set of finite element meshes.

Also allowed `.sh` and `.zef` files in `.gitignore`. A compilation of
all the individual commit messages this commit consisted of before
squashing are listed below (if the Git message field length allows).

-----------------------------------------------------------

.gitignore: allowed shell (.sh) scripts

Added zef_create_head_model.sh

Currently Zeffiro Interface throws an error when smoothing and
refinement are turned on in the variable ZEF_INPUT_SCRIPT.

zef_create_head_model: deactivated mesh smoothing and refinement

Added multicompartment_head_settings.m

This is to be passed to Zeffiro Interface in zef_create_head_model.sh,
in the input script.

zef_create_head_model: updated Zeffiro input script with multicompartment_head_settings.m

Also quoted paths stored in other variables.

script_zef_create_head_model: started preparing for looping over all subjects in a given directory

Still a few error cases to be handled in the for loop, before one should
dare trying to actually run Matlab.

zef_create_head_model: the script now starts ZI

Need to make sure it still works. Might have to terminate processes
manually when run.

Subject output file messages uncommented

Added files {mri2mesh,fs2zef}.sh to project root

The routine `mri2mesh.sh` is a rework of the `zef_create_head_model.sh`,
which also calls `fs2zef.sh` to create the required text segmentation
files in target subject folders. Currently only this step is implemented
in one form or another, but the intention is to include the mesh
generation in later, once this part is deemed to work.

mri2mesh: automated import script copying to FreeSurfer target folders

Also prettified output and updated comments.

mri2mesh: added paths required for mesh generation

script_zef_create_head_model: added mesh generation line

import_segmentation.zef: removed line with electrodes

Now the relevant data should start on line 56. Header lenght hardcoded
as 55 in Zeffiro.

.gitignore: allowed .zef files

mri2mesh: moved all related files into folder mri2mesh/

Also changed the import script path in `mri2mesh.sh` to reflect this.
Both `fs2zef.sh` and `import_segmentation.zef` are now expected to be
located in the same folder with `mri2mesh.sh`.

A README with instructions was also added to the folder.

multicompartment_head_settings also moved to mri2mesh/

Deleted zef_create_head_model as unnecessary

The script `mri2mesh.sh` repaces this.

mri2mesh: added a check for the existence of the MRI2ZEF folder...

... and added the variable ZI_DIR, which is assumed to point to the
parent folder of mri2mesh/.

mri2mesh: temporarily add zefiro_interface/ and mri2mesh/ to Matlab path

mri2mesh: added a check for the existence of zeffiro_interface.m in the supposed Zeffiro Interface folder

The script also now automatically changes the working directory to the
ZI folder and then back to the one where the script was called from,
once it is done running.
@sampsapursiainen sampsapursiainen merged commit 72649a9 into sampsapursiainen:main_development_branch Apr 30, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants