Skip to content

Commit

Permalink
Implement MATLAB generator and analysis tools
Browse files Browse the repository at this point in the history
  • Loading branch information
naegelejd committed Dec 13, 2024
1 parent eb60569 commit de629e7
Show file tree
Hide file tree
Showing 130 changed files with 5,336 additions and 0 deletions.
27 changes: 27 additions & 0 deletions matlab/+petsird/+binary/AnnulusShapeSerializer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.

classdef AnnulusShapeSerializer < yardl.binary.RecordSerializer
methods
function self = AnnulusShapeSerializer()
field_serializers{1} = yardl.binary.Float32Serializer;
field_serializers{2} = yardl.binary.Float32Serializer;
field_serializers{3} = yardl.binary.Float32Serializer;
field_serializers{4} = yardl.binary.FixedVectorSerializer(yardl.binary.Float32Serializer, 2);
[email protected]('petsird.AnnulusShape', field_serializers);
end

function write(self, outstream, value)
arguments
self
outstream (1,1) yardl.binary.CodedOutputStream
value (1,1) petsird.AnnulusShape
end
self.write_(outstream, value.inner_radius, value.outer_radius, value.thickness, value.angular_range);
end

function value = read(self, instream)
fields = self.read_(instream);
value = petsird.AnnulusShape(inner_radius=fields{1}, outer_radius=fields{2}, thickness=fields{3}, angular_range=fields{4});
end
end
end
25 changes: 25 additions & 0 deletions matlab/+petsird/+binary/AtomSerializer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.

classdef AtomSerializer < yardl.binary.RecordSerializer
methods
function self = AtomSerializer()
field_serializers{1} = yardl.binary.Uint32Serializer;
field_serializers{2} = yardl.binary.Uint32Serializer;
[email protected]('petsird.Atom', field_serializers);
end

function write(self, outstream, value)
arguments
self
outstream (1,1) yardl.binary.CodedOutputStream
value (1,1) petsird.Atom
end
self.write_(outstream, value.mass_number, value.atomic_number);
end

function value = read(self, instream)
fields = self.read_(instream);
value = petsird.Atom(mass_number=fields{1}, atomic_number=fields{2});
end
end
end
25 changes: 25 additions & 0 deletions matlab/+petsird/+binary/BedMovementTimeBlockSerializer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.

classdef BedMovementTimeBlockSerializer < yardl.binary.RecordSerializer
methods
function self = BedMovementTimeBlockSerializer()
field_serializers{1} = yardl.binary.Uint32Serializer;
field_serializers{2} = petsird.binary.RigidTransformationSerializer();
[email protected]('petsird.BedMovementTimeBlock', field_serializers);
end

function write(self, outstream, value)
arguments
self
outstream (1,1) yardl.binary.CodedOutputStream
value (1,1) petsird.BedMovementTimeBlock
end
self.write_(outstream, value.start, value.transform);
end

function value = read(self, instream)
fields = self.read_(instream);
value = petsird.BedMovementTimeBlock(start=fields{1}, transform=fields{2});
end
end
end
24 changes: 24 additions & 0 deletions matlab/+petsird/+binary/BoxShapeSerializer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.

classdef BoxShapeSerializer < yardl.binary.RecordSerializer
methods
function self = BoxShapeSerializer()
field_serializers{1} = yardl.binary.FixedVectorSerializer(petsird.binary.CoordinateSerializer(), 8);
[email protected]('petsird.BoxShape', field_serializers);
end

function write(self, outstream, value)
arguments
self
outstream (1,1) yardl.binary.CodedOutputStream
value (1,1) petsird.BoxShape
end
self.write_(outstream, value.corners);
end

function value = read(self, instream)
fields = self.read_(instream);
value = petsird.BoxShape(corners=fields{1});
end
end
end
28 changes: 28 additions & 0 deletions matlab/+petsird/+binary/BulkMaterialSerializer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.

classdef BulkMaterialSerializer < yardl.binary.RecordSerializer
methods
function self = BulkMaterialSerializer()
field_serializers{1} = yardl.binary.Uint32Serializer;
field_serializers{2} = yardl.binary.StringSerializer;
field_serializers{3} = yardl.binary.Float32Serializer;
field_serializers{4} = yardl.binary.VectorSerializer(petsird.binary.AtomSerializer());
field_serializers{5} = yardl.binary.VectorSerializer(yardl.binary.Float32Serializer);
[email protected]('petsird.BulkMaterial', field_serializers);
end

function write(self, outstream, value)
arguments
self
outstream (1,1) yardl.binary.CodedOutputStream
value (1,1) petsird.BulkMaterial
end
self.write_(outstream, value.id, value.name, value.density, value.atoms, value.mass_fractions);
end

function value = read(self, instream)
fields = self.read_(instream);
value = petsird.BulkMaterial(id=fields{1}, name=fields{2}, density=fields{3}, atoms=fields{4}, mass_fractions=fields{5});
end
end
end
26 changes: 26 additions & 0 deletions matlab/+petsird/+binary/CoincidenceEventSerializer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.

classdef CoincidenceEventSerializer < yardl.binary.RecordSerializer
methods
function self = CoincidenceEventSerializer()
field_serializers{1} = yardl.binary.FixedVectorSerializer(yardl.binary.Uint32Serializer, 2);
field_serializers{2} = yardl.binary.Uint32Serializer;
field_serializers{3} = yardl.binary.FixedVectorSerializer(yardl.binary.Uint32Serializer, 2);
[email protected]('petsird.CoincidenceEvent', field_serializers);
end

function write(self, outstream, value)
arguments
self
outstream (1,1) yardl.binary.CodedOutputStream
value (1,1) petsird.CoincidenceEvent
end
self.write_(outstream, value.detector_ids, value.tof_idx, value.energy_indices);
end

function value = read(self, instream)
fields = self.read_(instream);
value = petsird.CoincidenceEvent(detector_ids=fields{1}, tof_idx=fields{2}, energy_indices=fields{3});
end
end
end
24 changes: 24 additions & 0 deletions matlab/+petsird/+binary/CoordinateSerializer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.

classdef CoordinateSerializer < yardl.binary.RecordSerializer
methods
function self = CoordinateSerializer()
field_serializers{1} = yardl.binary.FixedNDArraySerializer(yardl.binary.Float32Serializer, [3]);
[email protected]('petsird.Coordinate', field_serializers);
end

function write(self, outstream, value)
arguments
self
outstream (1,1) yardl.binary.CodedOutputStream
value (1,1) petsird.Coordinate
end
self.write_(outstream, value.c);
end

function value = read(self, instream)
fields = self.read_(instream);
value = petsird.Coordinate(c=fields{1});
end
end
end
26 changes: 26 additions & 0 deletions matlab/+petsird/+binary/DeadTimeTimeBlockSerializer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.

classdef DeadTimeTimeBlockSerializer < yardl.binary.RecordSerializer
methods
function self = DeadTimeTimeBlockSerializer()
field_serializers{1} = petsird.binary.TimeIntervalSerializer();
field_serializers{2} = yardl.binary.NDArraySerializer(yardl.binary.Float32Serializer, 2);
field_serializers{3} = yardl.binary.NDArraySerializer(yardl.binary.Float32Serializer, 2);
[email protected]('petsird.DeadTimeTimeBlock', field_serializers);
end

function write(self, outstream, value)
arguments
self
outstream (1,1) yardl.binary.CodedOutputStream
value (1,1) petsird.DeadTimeTimeBlock
end
self.write_(outstream, value.time_interval, value.singles_alive_time_fraction, value.module_coincidence_alive_time_fraction);
end

function value = read(self, instream)
fields = self.read_(instream);
value = petsird.DeadTimeTimeBlock(time_interval=fields{1}, singles_alive_time_fraction=fields{2}, module_coincidence_alive_time_fraction=fields{3});
end
end
end
26 changes: 26 additions & 0 deletions matlab/+petsird/+binary/DetectionEfficienciesSerializer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.

classdef DetectionEfficienciesSerializer < yardl.binary.RecordSerializer
methods
function self = DetectionEfficienciesSerializer()
field_serializers{1} = yardl.binary.OptionalSerializer(yardl.binary.NDArraySerializer(yardl.binary.Float32Serializer, 2));
field_serializers{2} = yardl.binary.OptionalSerializer(yardl.binary.NDArraySerializer(yardl.binary.Int32Serializer, 2));
field_serializers{3} = yardl.binary.OptionalSerializer(yardl.binary.VectorSerializer(petsird.binary.ModulePairEfficienciesSerializer()));
[email protected]('petsird.DetectionEfficiencies', field_serializers);
end

function write(self, outstream, value)
arguments
self
outstream (1,1) yardl.binary.CodedOutputStream
value (1,1) petsird.DetectionEfficiencies
end
self.write_(outstream, value.det_el_efficiencies, value.module_pair_sgidlut, value.module_pair_efficiencies_vector);
end

function value = read(self, instream)
fields = self.read_(instream);
value = petsird.DetectionEfficiencies(det_el_efficiencies=fields{1}, module_pair_sgidlut=fields{2}, module_pair_efficiencies_vector=fields{3});
end
end
end
26 changes: 26 additions & 0 deletions matlab/+petsird/+binary/DetectorModuleSerializer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.

classdef DetectorModuleSerializer < yardl.binary.RecordSerializer
methods
function self = DetectorModuleSerializer()
field_serializers{1} = yardl.binary.VectorSerializer(petsird.binary.ReplicatedObjectSerializer(petsird.binary.SolidVolumeSerializer(petsird.binary.BoxShapeSerializer())));
field_serializers{2} = yardl.binary.VectorSerializer(yardl.binary.Uint32Serializer);
field_serializers{3} = yardl.binary.VectorSerializer(petsird.binary.ReplicatedObjectSerializer(petsird.binary.SolidVolumeSerializer(yardl.binary.UnionSerializer('petsird.GeometricShape', {petsird.binary.BoxShapeSerializer(), petsird.binary.AnnulusShapeSerializer()}, {@petsird.GeometricShape.BoxShape, @petsird.GeometricShape.AnnulusShape}))));
[email protected]('petsird.DetectorModule', field_serializers);
end

function write(self, outstream, value)
arguments
self
outstream (1,1) yardl.binary.CodedOutputStream
value (1,1) petsird.DetectorModule
end
self.write_(outstream, value.detecting_elements, value.detecting_element_ids, value.non_detecting_elements);
end

function value = read(self, instream)
fields = self.read_(instream);
value = petsird.DetectorModule(detecting_elements=fields{1}, detecting_element_ids=fields{2}, non_detecting_elements=fields{3});
end
end
end
24 changes: 24 additions & 0 deletions matlab/+petsird/+binary/DirectionMatrixSerializer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.

classdef DirectionMatrixSerializer < yardl.binary.RecordSerializer
methods
function self = DirectionMatrixSerializer()
field_serializers{1} = yardl.binary.FixedNDArraySerializer(yardl.binary.Float32Serializer, [3, 3]);
[email protected]('petsird.DirectionMatrix', field_serializers);
end

function write(self, outstream, value)
arguments
self
outstream (1,1) yardl.binary.CodedOutputStream
value (1,1) petsird.DirectionMatrix
end
self.write_(outstream, value.matrix);
end

function value = read(self, instream)
fields = self.read_(instream);
value = petsird.DirectionMatrix(matrix=fields{1});
end
end
end
24 changes: 24 additions & 0 deletions matlab/+petsird/+binary/DirectionSerializer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.

classdef DirectionSerializer < yardl.binary.RecordSerializer
methods
function self = DirectionSerializer()
field_serializers{1} = yardl.binary.FixedNDArraySerializer(yardl.binary.Float32Serializer, [3]);
[email protected]('petsird.Direction', field_serializers);
end

function write(self, outstream, value)
arguments
self
outstream (1,1) yardl.binary.CodedOutputStream
value (1,1) petsird.Direction
end
self.write_(outstream, value.c);
end

function value = read(self, instream)
fields = self.read_(instream);
value = petsird.Direction(c=fields{1});
end
end
end
27 changes: 27 additions & 0 deletions matlab/+petsird/+binary/EventTimeBlockSerializer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.

classdef EventTimeBlockSerializer < yardl.binary.RecordSerializer
methods
function self = EventTimeBlockSerializer()
field_serializers{1} = yardl.binary.Uint32Serializer;
field_serializers{2} = yardl.binary.VectorSerializer(petsird.binary.CoincidenceEventSerializer());
field_serializers{3} = yardl.binary.OptionalSerializer(yardl.binary.VectorSerializer(petsird.binary.CoincidenceEventSerializer()));
field_serializers{4} = yardl.binary.OptionalSerializer(yardl.binary.VectorSerializer(petsird.binary.TripleEventSerializer()));
[email protected]('petsird.EventTimeBlock', field_serializers);
end

function write(self, outstream, value)
arguments
self
outstream (1,1) yardl.binary.CodedOutputStream
value (1,1) petsird.EventTimeBlock
end
self.write_(outstream, value.start, value.prompt_events, value.delayed_events, value.triple_events);
end

function value = read(self, instream)
fields = self.read_(instream);
value = petsird.EventTimeBlock(start=fields{1}, prompt_events=fields{2}, delayed_events=fields{3}, triple_events=fields{4});
end
end
end
27 changes: 27 additions & 0 deletions matlab/+petsird/+binary/ExamInformationSerializer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.

classdef ExamInformationSerializer < yardl.binary.RecordSerializer
methods
function self = ExamInformationSerializer()
field_serializers{1} = petsird.binary.SubjectSerializer();
field_serializers{2} = petsird.binary.InstitutionSerializer();
field_serializers{3} = yardl.binary.OptionalSerializer(yardl.binary.StringSerializer);
field_serializers{4} = yardl.binary.OptionalSerializer(yardl.binary.DatetimeSerializer);
[email protected]('petsird.ExamInformation', field_serializers);
end

function write(self, outstream, value)
arguments
self
outstream (1,1) yardl.binary.CodedOutputStream
value (1,1) petsird.ExamInformation
end
self.write_(outstream, value.subject, value.institution, value.protocol, value.start_of_acquisition);
end

function value = read(self, instream)
fields = self.read_(instream);
value = petsird.ExamInformation(subject=fields{1}, institution=fields{2}, protocol=fields{3}, start_of_acquisition=fields{4});
end
end
end
26 changes: 26 additions & 0 deletions matlab/+petsird/+binary/ExternalSignalTimeBlockSerializer.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.

classdef ExternalSignalTimeBlockSerializer < yardl.binary.RecordSerializer
methods
function self = ExternalSignalTimeBlockSerializer()
field_serializers{1} = yardl.binary.Uint32Serializer;
field_serializers{2} = yardl.binary.Uint32Serializer;
field_serializers{3} = yardl.binary.VectorSerializer(yardl.binary.Float32Serializer);
[email protected]('petsird.ExternalSignalTimeBlock', field_serializers);
end

function write(self, outstream, value)
arguments
self
outstream (1,1) yardl.binary.CodedOutputStream
value (1,1) petsird.ExternalSignalTimeBlock
end
self.write_(outstream, value.start, value.signal_id, value.signal_values);
end

function value = read(self, instream)
fields = self.read_(instream);
value = petsird.ExternalSignalTimeBlock(start=fields{1}, signal_id=fields{2}, signal_values=fields{3});
end
end
end
Loading

0 comments on commit de629e7

Please sign in to comment.