Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 13, 2024
1 parent 254323e commit e60458c
Show file tree
Hide file tree
Showing 130 changed files with 3,882 additions and 4,288 deletions.
74 changes: 41 additions & 33 deletions matlab/buildfile.m
Original file line number Diff line number Diff line change
@@ -1,49 +1,57 @@
function plan = buildfile
% import matlab.buildtool.tasks.CodeIssuesTask
% import matlab.buildtool.tasks.TestTask
function plan = buildfile % import matlab.buildtool.tasks.CodeIssuesTask
% import matlab.buildtool.tasks.TestTask

plan = buildplan(localfunctions);
% plan("check") = CodeIssuesTask(Results="tests/results/static-analysis-results.sarif");
% plan("test") = TestTask("tests", SourceFiles="toolbox", TestResults="tests/results/test-results.xml");
plan
= buildplan (localfunctions);
% plan ("check")
= CodeIssuesTask (Results = "tests/results/static-analysis-results.sarif");
% plan ("test") = TestTask ("tests", SourceFiles = "toolbox",
TestResults = "tests/results/test-results.xml");

% plan("packageToolbox").Dependencies = ["check" "test"];
% plan ("packageToolbox").Dependencies = ["check"
"test"];

plan.DefaultTasks = ["packageToolbox"];
plan.DefaultTasks = ["packageToolbox"];
end

function packageToolboxTask(~)
buildToolbox("release");
function packageToolboxTask (~) buildToolbox ("release");
end

function buildToolbox(outdir)
if ~exist(outdir, 'dir')
mkdir(outdir);
end
function buildToolbox (outdir) if ~exist (outdir, 'dir') mkdir (outdir);
end

uuid = string(java.util.UUID.randomUUID());
toolboxFolder = "./toolbox/";
opts = matlab.addons.toolbox.ToolboxOptions(toolboxFolder, uuid);
uuid
= string (java.util.UUID.randomUUID ());
toolboxFolder = "./toolbox/";
opts = matlab.addons.toolbox.ToolboxOptions (toolboxFolder, uuid);

toolboxDirs = unique(fileparts(opts.ToolboxFiles));
if ~all(contains(toolboxDirs, opts.ToolboxFolder))
error("No symbolic links allowed in toolboxFolder (BUG through at least R2023a)");
end
toolboxDirs = unique (fileparts (opts.ToolboxFiles));
if
~all (contains (toolboxDirs, opts.ToolboxFolder))
error ("No symbolic links allowed in toolboxFolder (BUG through at "
"least R2023a)");
end

opts.ToolboxName = "PETSIRD";
opts.ToolboxName
= "PETSIRD";

opts.ToolboxVersion = "0.2.0";
opts.OutputFile = fullfile(outdir, sprintf("petsird-%s.mltbx", opts.ToolboxVersion));
opts.ToolboxVersion = "0.2.0";
opts.OutputFile
= fullfile (outdir, sprintf ("petsird-%s.mltbx", opts.ToolboxVersion));

opts.Description = "Positron Emission Tomography Standardization Initiative Raw Data (PETSIRD) toolbox for MATLAB";
% opts.Summary = "";
% opts.AuthorCompany = "";
opts.Description = "Positron Emission Tomography Standardization Initiative "
"Raw Data (PETSIRD) toolbox for MATLAB";
% opts.Summary = "";
% opts.AuthorCompany = "";

opts.MinimumMatlabRelease = "R2022b";
opts.MinimumMatlabRelease = "R2022b";

% Must also specify which folders should be added to MATLAB path upon toolbox installation.
% Must also include at least one *file* in the toolbox folder.
% This seems to be bug on Linux, Matlab R2023a. On Windows, this isn't required.
opts.ToolboxMatlabPath = toolboxFolder;
% Must also specify which folders should be added to MATLAB path upon toolbox
installation.
% Must also include at least one *file *in the toolbox folder.
% This seems to be bug on Linux,
Matlab R2023a.On Windows,
this isn't required. opts.ToolboxMatlabPath = toolboxFolder;

matlab.addons.toolbox.packageToolbox(opts);
matlab.addons.toolbox.packageToolbox (opts);
end
52 changes: 28 additions & 24 deletions matlab/toolbox/+petsird/+binary/AnnulusShapeSerializer.m
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.
% 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
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);
self
@yardl.binary.RecordSerializer ('petsird.AnnulusShape', field_serializers);
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
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
40 changes: 18 additions & 22 deletions matlab/toolbox/+petsird/+binary/AtomSerializer.m
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.
% 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
classdef AtomSerializer
< yardl.binary.RecordSerializer methods function self
= AtomSerializer () field_serializers{ 1 } = yardl.binary.Uint32Serializer;
field_serializers{ 2 } = yardl.binary.Uint32Serializer;
self @yardl.binary.RecordSerializer ('petsird.Atom', field_serializers);
end

function value = read(self, instream)
fields = self.read_(instream);
value = petsird.Atom(mass_number=fields{1}, atomic_number=fields{2});
end
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
45 changes: 23 additions & 22 deletions matlab/toolbox/+petsird/+binary/BedMovementTimeBlockSerializer.m
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.
% 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
classdef BedMovementTimeBlockSerializer
< yardl.binary.RecordSerializer methods function self
= BedMovementTimeBlockSerializer () field_serializers{ 1 }
= yardl.binary.Uint32Serializer;
field_serializers{ 2 } = petsird.binary.RigidTransformationSerializer ();
self @yardl.binary.RecordSerializer ('petsird.BedMovementTimeBlock',
field_serializers);
end

function value = read(self, instream)
fields = self.read_(instream);
value = petsird.BedMovementTimeBlock(start=fields{1}, transform=fields{2});
end
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
39 changes: 18 additions & 21 deletions matlab/toolbox/+petsird/+binary/BoxShapeSerializer.m
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.
% 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
classdef BoxShapeSerializer
< yardl.binary.RecordSerializer methods function self
= BoxShapeSerializer () field_serializers{ 1 }
= yardl.binary.FixedVectorSerializer (petsird.binary.CoordinateSerializer (),
8);
self @yardl.binary.RecordSerializer ('petsird.BoxShape', field_serializers);
end

function value = read(self, instream)
fields = self.read_(instream);
value = petsird.BoxShape(corners=fields{1});
end
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
55 changes: 30 additions & 25 deletions matlab/toolbox/+petsird/+binary/BulkMaterialSerializer.m
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.
% 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
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);
self
@yardl.binary.RecordSerializer ('petsird.BulkMaterial', field_serializers);
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
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
47 changes: 24 additions & 23 deletions matlab/toolbox/+petsird/+binary/CoincidenceEventSerializer.m
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
% This file was generated by the "yardl" tool. DO NOT EDIT.
% 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
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);
self @yardl.binary.RecordSerializer ('petsird.CoincidenceEvent',
field_serializers);
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
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
Loading

0 comments on commit e60458c

Please sign in to comment.