From 7a9aeccd9a9affe9d04d956490e1508b4a0fe4c7 Mon Sep 17 00:00:00 2001 From: ernesto-vidal <61276100+ernesto-vidal@users.noreply.github.com> Date: Tue, 15 Nov 2022 13:12:16 +0000 Subject: [PATCH] Add available landmarks to NIRS SD3D output (#40) * Include cranial landmarks in .nirs file The saving function write_NIRS was missing the cranial landmarks in the SD3D structure * Added comments to write_NIRS write_NIRS was modified to include landmarks and comments were added to clarify changes * Update write_NIRS.m Cranial landmark names were missing in the SD3D structure, this has been amended. --- +lumofile/read_lufr.m | 2 +- +lumofile/write_NIRS.m | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/+lumofile/read_lufr.m b/+lumofile/read_lufr.m index abfed7a..21c725b 100644 --- a/+lumofile/read_lufr.m +++ b/+lumofile/read_lufr.m @@ -798,7 +798,7 @@ % Load layout or take from the user -if isempty(layout_override) & (n_layouts == 0) +if isempty(layout_override) && (n_layouts == 0) % The user has nor provided a layout, we must use the embedded data if it exists % enum.groups(gidx + 1).layout = []; diff --git a/+lumofile/write_NIRS.m b/+lumofile/write_NIRS.m index 6483492..fe87c20 100644 --- a/+lumofile/write_NIRS.m +++ b/+lumofile/write_NIRS.m @@ -210,6 +210,23 @@ end +% Add Landmarks to SD3D +% +SD3D.Landmarks = zeros(size(layout.landmarks,1),3); +SD3D.LandmarksNames = cell(1,size(layout.landmarks,1)); +for li = 1:size(layout.landmarks,1) + SD3D.Landmarks(li,1) = layout.landmarks(li).coords_3d.x; + SD3D.Landmarks(li,2) = layout.landmarks(li).coords_3d.y; + SD3D.Landmarks(li,3) = layout.landmarks(li).coords_3d.z; + +% Add Landmarks names + SD3D.LandmarksNames{li} = layout.landmarks(li).name; + +end + + + + % Build MeasList % SD.MeasList = zeros(size(glch,1), 4);