diff --git a/ShoulderCase/@LandmarksExporter/LandmarksExporter.m b/ShoulderCase/@LandmarksExporter/LandmarksExporter.m new file mode 100644 index 0000000..d020ba1 --- /dev/null +++ b/ShoulderCase/@LandmarksExporter/LandmarksExporter.m @@ -0,0 +1,17 @@ +classdef LandmarksExporter < handle + + properties (Access = private) + SCase + end + + + + methods + + function obj = LandmarksExporter(SCase) + obj.Scase = SCase; + end + + end + +end \ No newline at end of file diff --git a/ShoulderCase/@LandmarksExporter/getAmiraLandmarksFileWithPoints.m b/ShoulderCase/@LandmarksExporter/getAmiraLandmarksFileWithPoints.m new file mode 100644 index 0000000..242213d --- /dev/null +++ b/ShoulderCase/@LandmarksExporter/getAmiraLandmarksFileWithPoints.m @@ -0,0 +1,9 @@ +function output = getAmiraLandmarksFileWithPoints(obj,points) + rawText = obj.getAmiraLandmarksRawFile(); + fileText = sprintf(rawText,size(points,1)); + for i = 1:size(points,1) + textFromPoint = replace([num2str(points(i,1),'%10.15e') ' ' num2str(points(i,2),'%10.15e') ' ' num2str(points(i,3),'%10.15e') '\n'],'e+','e+0'); + fileText = [fileText textFromPoint]; + end + output = fileText; +end \ No newline at end of file diff --git a/ShoulderCase/@LandmarksExporter/getAmiraLandmarksRawFile.m b/ShoulderCase/@LandmarksExporter/getAmiraLandmarksRawFile.m new file mode 100644 index 0000000..2df550e --- /dev/null +++ b/ShoulderCase/@LandmarksExporter/getAmiraLandmarksRawFile.m @@ -0,0 +1,20 @@ +function output = getAmiraLandmarksRawFile(obj) + output = ['# AmiraMesh 3D ASCII 2.0\n',... + '\n',... + '\n',... + 'define Markers %d\n',... + '\n',... + 'Parameters {\n',... + ' NumSets 1,\n',... + ' ContentType "LandmarkSet"\n',... + '}\n',... + '\n',... + 'Markers { float[3] Coordinates } @1\n',... + '\n',... + '# Data section follows\n',... + '@1\n',... + ]; +end + + +