Closed mshavliuk closed 1 year ago
This issue is not applicable to the main_development_branch
branch and was noticed only in 192-fs2zefsh-improvements
It looks like the order of struct
fields inside of the color table files generated by fs2zef.sh
are different between the old multicompartment_head_project
and the newer segmentations generated by fs2zef.m
. Previously it was parcellation_aux{1}
that contained the struct
, but in the newer segmentations it is parcellation_aux{3}
that contains it.
This is a bit strange since the Matlab function that saves the color table files, and which is called by fs2zef.m
, is the same as before. It might also be that the segmentation in multicompartment_head_project
was generated with an older version of FreeSurfer. With the new segmentations, the line that now causes errors works just fine, at least with s certain .nii
file.
The sensible thing to do here would be to rewrite the entire import routine, such that it does not rely on the field order of the struct
, returned by load("file.mat")
.
@mshavliuk I added an order-agnostic way of loading the fields from the color table files generated by the function called by fs2zef.m
to the HEAD of 192-fs2zefsh-improvements
. I tested it with a newer segmentation and the older one in
scripts/scripts_for_importing/multicompartment_head_project
and they both seem to pass without errors. What still needs testing is the mesh generation, since it relies on the imported segmentation being correct. If it works with both newer and older segmentations, then the relevant branch can be merged to main_development_branch
.
It seems like at least a mesh can be generated with the given newer and older segmentations. I think #193 might be safe to merge at this point.
It seems like at least a mesh can be generated with the given newer and older segmentations. I think #193 might be safe to merge at this point.
I will test it shortly and let you know if everything's ok
Description
I can't import the multicompartment head project from this directory, even though it was possible recently
Steps to reproduce
Run via import example:
Gives me this error:
Alternatively, when I try to import the same project manually, I get exactly the same error, although I can see that some parts of the project are successfully imported. See the screenshot below
Expected behavior
The project gets imported.
Screenshots
Context