Changeset 6447
 Timestamp:
 06/02/10 15:46:34 (10 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/components/lociplugins/test/loci/plugins/in/ImporterTest.java
r6441 r6447 512 512 private void datasetSwapDimsTest(int pixType, int x, int y, int z, int t) 513 513 { 514 int c = 3; ChannelOrder origOrder = ChannelOrder.ZCT, swappedOrder = ChannelOrder.TCZ; 514 int c = 3; 515 ChannelOrder swappedOrder = ChannelOrder.TCZ; // original order is ZCT 515 516 String path = constructFakeFilename("swapDims", pixType, x, y, z, c, t, 1, false, 1, false); 516 517 ImagePlus[] imps = null; … … 539 540 assertEquals(z*c*t,numSlices); 540 541 541 // make sure the dimensions were swapped correctly 542 // verify that the dimensional extents were swapped 543 final int actualSizeZ = imp.getNSlices(); 544 final int actualSizeC = imp.getNChannels(); 545 final int actualSizeT = imp.getNFrames(); 546 assertEquals(t, actualSizeZ); // Z<>T swapped 547 assertEquals(c, actualSizeC); 548 assertEquals(z, actualSizeT); // Z<>T swapped 549 550 // verify that every plane appears in the swapped order 542 551 int p = 1; 543 for (int zIndex = 0; zIndex < z; zIndex++)552 for (int tIndex = 0; tIndex < actualSizeT; tIndex++) 544 553 for (int cIndex = 0; cIndex < c; cIndex++) 545 for (int tIndex = 0; tIndex < t; tIndex++)554 for (int zIndex = 0; zIndex < actualSizeZ; zIndex++) 546 555 { 547 556 ImageProcessor proc = st.getProcessor(p++); 548 assertEquals(tIndex,zIndex(proc)); // Z<>T swapped 549 assertEquals(cIndex,cIndex(proc)); 550 assertEquals(zIndex,tIndex(proc)); // Z<>T swapped 557 final int actualZ = tIndex(proc); // Z<>T swapped 558 final int actualC = cIndex(proc); 559 final int actualT = zIndex(proc); // Z<>T swapped 560 assertEquals(zIndex, actualZ); 561 assertEquals(cIndex, actualC); 562 assertEquals(tIndex, actualT); 551 563 } 552 564 }
Note: See TracChangeset
for help on using the changeset viewer.