Skip to content

Commit 96b5ac7

Browse files
committed
test Availability functions and fix corresponding issues
1 parent 0518651 commit 96b5ac7

8 files changed

+13
-10
lines changed

matRad/steering/matRad_ParticleStfGeneratorIMPT.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
end
280280

281281
% Check superclass availability
282-
[available,msg] = matRad_ParticleStfGeneratorRayBixelAbstract.IsAvailable(pln,machine);
282+
[available,msg] = matRad_ParticleStfGeneratorRayBixelAbstract.isAvailable(pln,machine);
283283

284284
if ~available
285285
return;
@@ -298,7 +298,7 @@
298298
checkModality = strcmp(machine.meta.radiationMode,pln.radiationMode);
299299
end
300300

301-
preCheck = checkBasic && checkModality;
301+
preCheck = checkModality;
302302

303303
if ~preCheck
304304
return;

matRad/steering/matRad_ParticleStfGeneratorRayBixelAbstract.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ function initialize(this)
8686
end
8787

8888
% Check superclass availability
89-
[available,msg] = matRad_ExternalStfGeneratorRayBixelAbstract.IsAvailable(pln,machine);
89+
[available,msg] = matRad_ExternalStfGeneratorRayBixelAbstract.isAvailable(pln,machine);
9090

9191
if ~available
9292
return;
9393
end
9494

9595
available = available && isstruct(machine.data);
9696

97-
available = available && all(isfield(machine.data),{'energy','peakPos','initFocus','offset'});
97+
available = available && all(isfield(machine.data,{'energy','peakPos','initFocus','offset'}));
9898

9999

100100
if ~available

matRad/steering/matRad_ParticleStfGeneratorSingleBeamlet.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ function createPatientGeometry(this)
208208
end
209209

210210
% Check superclass availability
211-
[available,msg] = matRad_ParticleStfGeneratorRayBixelAbstract.IsAvailable(pln,machine);
211+
[available,msg] = matRad_ParticleStfGeneratorRayBixelAbstract.isAvailable(pln,machine);
212212

213213
if ~available
214214
return;

matRad/steering/matRad_PhotonStfGeneratorIMRT.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
end
3737

3838
% Check superclass availability
39-
[available,msg] = matRad_PhotonStfGeneratorRayBixelAbstract.IsAvailable(pln,machine);
39+
[available,msg] = matRad_PhotonStfGeneratorRayBixelAbstract.isAvailable(pln,machine);
4040

4141
if ~available
4242
return;

matRad/steering/matRad_PhotonStfGeneratorRayBixelAbstract.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function setDefaults(this)
7979
end
8080

8181
% Check superclass availability
82-
[available,msg] = matRad_ExternalStfGeneratorRayBixelAbstract.IsAvailable(pln,machine);
82+
[available,msg] = matRad_ExternalStfGeneratorRayBixelAbstract.isAvailable(pln,machine);
8383

8484
if ~available
8585
return;

matRad/steering/matRad_PhotonStfGeneratorSingleBeamlet.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
end
5555

5656
% Check superclass availability
57-
[available,msg] = matRad_PhotonStfGeneratorRayBixelAbstract.IsAvailable(pln,machine);
57+
[available,msg] = matRad_PhotonStfGeneratorRayBixelAbstract.isAvailable(pln,machine);
5858

5959
if ~available
6060
return;

test/steering/test_stfGeneratorParticleBeamlet.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
function test_basic_construct()
88
stfGen = matRad_ParticleStfGeneratorSingleBeamlet();
99
assertTrue(isa(stfGen, 'matRad_ParticleStfGeneratorSingleBeamlet'));
10-
assertEqual(stfGen.radiationMode,'protons')
10+
assertEqual(stfGen.radiationMode,'protons');
1111

1212
function test_pln_construct()
1313
load protons_testData.mat
1414
stfGen = matRad_ParticleStfGeneratorSingleBeamlet(pln);
15+
assertTrue(stfGen.isAvailable(pln));
1516
assertTrue(isa(stfGen, 'matRad_ParticleStfGeneratorSingleBeamlet'));
1617
assertEqual(stfGen.gantryAngles, pln.propStf.gantryAngles);
1718
assertEqual(stfGen.couchAngles, pln.propStf.couchAngles);
@@ -23,11 +24,13 @@ function test_pln_construct()
2324

2425
pln.radiationMode = 'helium';
2526
stfGen = matRad_ParticleStfGeneratorSingleBeamlet(pln);
27+
assertTrue(stfGen.isAvailable(pln));
2628
assertTrue(isa(stfGen, 'matRad_ParticleStfGeneratorSingleBeamlet'));
2729
assertEqual(stfGen.radiationMode, pln.radiationMode);
2830

2931
pln.radiationMode = 'carbon';
3032
stfGen = matRad_ParticleStfGeneratorSingleBeamlet(pln);
33+
assertTrue(stfGen.isAvailable(pln));
3134
assertTrue(isa(stfGen, 'matRad_ParticleStfGeneratorSingleBeamlet'));
3235
assertEqual(stfGen.radiationMode, pln.radiationMode);
3336

test/steering/test_stfGeneratorPhotonBixel.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ function test_basic_construct()
1111
function test_pln_construct()
1212
load photons_testData.mat
1313
stfGen = matRad_PhotonStfGeneratorSingleBeamlet(pln);
14+
stfGen.isAvailable(pln);
1415
assertTrue(isa(stfGen, 'matRad_PhotonStfGeneratorSingleBeamlet'));
1516
assertEqual(stfGen.gantryAngles, pln.propStf.gantryAngles);
1617
assertEqual(stfGen.couchAngles, pln.propStf.couchAngles);
@@ -26,7 +27,6 @@ function test_generate_multibeams()
2627
stfGen = matRad_PhotonStfGeneratorSingleBeamlet(pln);
2728
stf = stfGen.generate(ct,cst);
2829

29-
3030
assertTrue(isfield(stf, 'radiationMode'));
3131
assertTrue(isfield(stf, 'machine'));
3232
assertTrue(isfield(stf, 'gantryAngle'));

0 commit comments

Comments
 (0)