Skip to content

Commit

Permalink
Merge pull request #176 from bls337/main
Browse files Browse the repository at this point in the history
simplify more loops
  • Loading branch information
bls337 authored Oct 4, 2023
2 parents fe8c7b3 + 66e16f4 commit a695567
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,8 @@ public void close() {
}
}

for (int positionIndex = 0; positionIndex < (acqSettings_.isUsingMultiplePositions() ?
pl.getNumberOfPositions() : 1); positionIndex++) {
final int numPositions = acqSettings_.isUsingMultiplePositions() ? pl.getNumberOfPositions() : 1;
for (int positionIndex = 0; positionIndex < numPositions; positionIndex++) {
AcquisitionEvent baseEvent = new AcquisitionEvent(currentAcquisition_);
if (acqSettings_.isUsingMultiplePositions()) {
baseEvent.setAxisPosition(LSMAcquisitionEvents.POSITION_AXIS, positionIndex);
Expand All @@ -570,8 +570,8 @@ public void close() {
}
} else {
// Loop 2: Multiple time points
for (int timeIndex = 0; timeIndex < (acqSettings_.isUsingTimePoints() ?
acqSettings_.numTimePoints() : 1); timeIndex++) {
final int numTimePoints = acqSettings_.isUsingTimePoints() ? acqSettings_.numTimePoints() : 1;
for (int timeIndex = 0; timeIndex < numTimePoints; timeIndex++) {
baseEvent.setTimeIndex(timeIndex);
// Loop 3: Channels; Loop 4: Z slices (non-interleaved)
// Loop 3: Channels; Loop 4: Z slices (interleaved)
Expand Down

0 comments on commit a695567

Please sign in to comment.