Skip to content

Commit

Permalink
Merge pull request #175 from bls337/main
Browse files Browse the repository at this point in the history
simplify loops
  • Loading branch information
bls337 authored Oct 4, 2023
2 parents cf756ba + ec23411 commit fe8c7b3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1348,8 +1348,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 @@ -1371,8 +1371,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 fe8c7b3

Please sign in to comment.