@@ -538,11 +538,13 @@ TEST(Dataset, iselWithStrideAndExistingData) {
538
538
std::string testPath = " zarrs/slice_scale_test" ;
539
539
float scaleFactor = 2 .5f ;
540
540
541
- // --- Step 1: Initialize the entire image variable with QC values and Write it ---
541
+ // --- Step 1: Initialize the entire image variable with QC values and Write
542
+ // it ---
542
543
{
543
544
// Create a new dataset
544
545
auto json_vars = GetToyExample ();
545
- auto dataset = mdio::Dataset::from_json (json_vars, testPath, mdio::constants::kCreateClean );
546
+ auto dataset = mdio::Dataset::from_json (json_vars, testPath,
547
+ mdio::constants::kCreateClean );
546
548
ASSERT_TRUE (dataset.status ().ok ()) << dataset.status ();
547
549
auto ds = dataset.value ();
548
550
@@ -571,7 +573,8 @@ TEST(Dataset, iselWithStrideAndExistingData) {
571
573
ASSERT_TRUE (writeFut.status ().ok ()) << writeFut.status ();
572
574
} // End of Step 1
573
575
574
- // --- Step 2: Slice with stride of 2 and scale the values of the "image" variable ---
576
+ // --- Step 2: Slice with stride of 2 and scale the values of the "image"
577
+ // variable ---
575
578
{
576
579
// Re-open the dataset for modifications.
577
580
auto reopenedDsFut = mdio::Dataset::Open (testPath, mdio::constants::kOpen );
@@ -594,9 +597,10 @@ TEST(Dataset, iselWithStrideAndExistingData) {
594
597
auto imageData = imageDataFut.value ();
595
598
auto imageAccessor = imageData.get_data_accessor ().data ();
596
599
597
- // The sliced "image" now has dimensions 128 x 512 x 384 because we selected every 2nd index.
598
- // Scale each element in the slice by 'scaleFactor'
599
- for (uint32_t ii = 0 ; ii < 128 ; ii++) { // 'ii' corresponds to original index i = ii * 2.
600
+ // The sliced "image" now has dimensions 128 x 512 x 384 because we selected
601
+ // every 2nd index. Scale each element in the slice by 'scaleFactor'
602
+ for (uint32_t ii = 0 ; ii < 128 ;
603
+ ii++) { // 'ii' corresponds to original index i = ii * 2.
600
604
for (uint32_t j = 0 ; j < 512 ; j++) {
601
605
for (uint32_t k = 0 ; k < 384 ; k++) {
602
606
size_t index = ii * (512 * 384 ) + j * 384 + k;
@@ -626,8 +630,9 @@ TEST(Dataset, iselWithStrideAndExistingData) {
626
630
auto imageAccessor = imageData.get_data_accessor ().data ();
627
631
628
632
// Validate the values over the entire "image" variable.
629
- // For even inline indices (i % 2 == 0) we expect the initial QC value scaled by 'scaleFactor'.
630
- // For odd inline indices, the original QC values should remain.
633
+ // For even inline indices (i % 2 == 0) we expect the initial QC value
634
+ // scaled by 'scaleFactor'. For odd inline indices, the original QC values
635
+ // should remain.
631
636
for (uint32_t i = 0 ; i < 256 ; i++) {
632
637
for (uint32_t j = 0 ; j < 512 ; j++) {
633
638
for (uint32_t k = 0 ; k < 384 ; k++) {
0 commit comments