sampsapursiainen / zeffiro_interface

Interface for using finite elements in inverse problems with complex domains
GNU General Public License v3.0
24 stars 15 forks source link

Reorganize folders 2023-08-18 #248

Closed SeSodesa closed 1 year ago

SeSodesa commented 1 year ago

This pull request (once marked as ready) re-organises and removes folders and files, to make the Zeffiro Interface project structure a bit more user friendly. The aim is to reduce clutter in the top-level folder, while making certain folder names more descriptive.

For now, the following changes are planned:

  1. Create folder +core/ for core functionality, that needs to be available to other packages even before Zeffiro has been started up, and the required folders have been added to the MATLAB path. Also, some Zeffiro Scripts were written using eval, which prevents placing local functions at the ends of those script files, which requires placing them here. The +import/ and +gui/ folders, and the type definition ZefSourceModel were moved here.
  2. The new +examples/ folder is now the canonical location for any examples of Zeffiro use. Since studies made with Zeffiro are also examples of its use, the folder +examples/+studies/ houses studies that have been made with Zeffiro, which makes repeating the experiments easy from the command line without adding anything to the path or starting up Zeffiro beforehand. For example, the code used to generate the results of https://doi.org/10.48550/arXiv.2308.04908 are in +examples/+studies/+santtus_peeling_article/.
  3. The folder +utilities is now the place for any miscellaneous helper functions, that might or might not be related to Zeffiro Interface core functionality. For example, the folder +utilities/+cluster/ now houses the functions and instructions related to sending MATLAB jobs to the CSC supercluster.
  4. The module +mri2mesh/ is moved under the folder +utilities/+fs2zef, and its main function is renamed from fs2zef to run, to make it obvious which function starts the MRI-to-mesh transformation. The program is now started with utilities.fs2zef.run(args). Other import scripts are also transferred with the same name pattern utilities.format2zef, where format is the program format from which data is imported to Zeffiro-importable form.
  5. The existing external dependencies in the external/ are now all converted to Git submodules, and the file .gitmodules contains all of the necessary information, such as paths and startup scripts required to install them. The function zeffiro_setup now relies on this file being in the correct format, since it parses the file for submodule installation information.
  6. The scripts/ folder has mostly been emptied, and now contains a notification in scripts/README.md of its intended purpose. Any functionality previously in this folder has been transferred to one of the new package folders. For example, the example segmentation generated by FreeSurfer is now in the data/segmentations/ folder, since it is mainly data and not code.
  7. Update the zef.source_model fields in data/example_projects/{ary_sphere_project,multicompartment_head_project}.mat to reflect the new location of ZefSourceModel in the +core folder. The asteroid projects should be unaffected, as the source_model fields were saved into them as plain integers.
  8. The folder +zeffiro/ was removed, as it was completely unnecessary and unused.

Since this pull request is mainly related to moving existing content to more sensible locations and making it work if it didn't, very little was actually removed, unless deemed completely unnecessary. Legacy content, such as the fig/ folder might be removed in a separate update.

Closes #244.

SeSodesa commented 1 year ago

Thanks to @JoonasJL for testing the Ary model case. The discovered bug related to loading ZefSourceModels from .mat files should probably be fixed before merging. We need to define a loadobj method for the class.

SeSodesa commented 1 year ago

Thanks to @JoonasJL for testing the Ary model case. The discovered bug related to loading ZefSourceModels from .mat files should probably be fixed before merging. We need to define a loadobj method for the class.

This has now been resolved. See the edits in the opening message.