Changeset 6421
 Timestamp:
 05/28/10 16:58:06 (10 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/components/lociplugins/test/loci/plugins/in/ImporterTest.java
r6410 r6421 360 360 } 361 361 362 /** get the actual pixel value (lookup when data is indexed) of the index of a fake image at a given z,c,t */ 363 private int getIndexPixelValue(CompositeImage ci, int z, int c, int t, boolean indexed) 364 { 365 // if I have numZ=2,numC=3,numT=4 then don't I have 24 images? why only testing c values makes a difference? 366 367 // our indices are 0based while IJ's are 1based 368 ci.setPosition(c+1, z+1, t+1); 369 int rawValue = iIndex(ci.getProcessor()); 370 //int rawValue = iIndex(ci.getProcessor(c+1)); 371 System.out.println("zct "+z+" "+c+" "+t+" rawVal "+rawValue); 372 if (indexed) 373 return ci.getChannelLut(c+1).getRGB(rawValue); 374 else 375 return rawValue; 376 } 377 362 378 // ****** helper tests **************************************************************************************** 363 379 … … 684 700 } 685 701 686 private int getPixelValue(CompositeImage ci, int channel, boolean indexed)687 {688 int rawValue = iIndex(ci.getProcessor(channel));689 if (indexed)690 return ci.getChannelLut(channel).getRGB(rawValue);691 else692 return rawValue;693 }694 695 702 private void colorCompositeTest(boolean indexed, int pixType, int sizeX, int sizeY, int sizeZ, int sizeC, int sizeT, int numSeries) 696 703 { … … 739 746 740 747 colorTests(ci,sizeC,DefaultColorOrder); 748 749 ci.reset(); // force the channel processors to get initialized, otherwise nullptr  TODO : does this point out a IJ bug? 750 751 System.out.println("Checking index vals"); 752 System.out.println("maxes z c t = "+ci.getNSlices()+" "+ci.getNChannels()+" "+ci.getNFrames()); 753 // check that each image in the overall series has the correct iIndex value 754 for (int z = 0; z < ci.getNSlices(); z++) 755 for (int c = 0; c < ci.getNChannels(); c++) 756 for (int t = 0; t < ci.getNFrames(); t++) 757 { 758 //getIndexPixelValue(ci,z,c,t,indexed); 759 assertEquals((6*t+3*z+c),getIndexPixelValue(ci,z,c,t,indexed)); 760 } 741 761 } 742 762 … … 1166 1186 // BF only supporting C from 2 to 7 and due to IJ's slider limitation (C*numSeries*3) <= 25 1167 1187 1188 colorCompositeTest(false,FormatTools.UINT8,55,44,2,3,4,1); 1168 1189 colorCompositeTest(true,FormatTools.UINT8,55,44,2,3,4,1); 1169 1190 … … 1176 1197 int[] series = new int[] {1,2,3,4}; 1177 1198 1178 for (int pixFormat : pixTypes) {1179 for (int x : xs) {1180 for (int y : ys) {1181 for (int z : zs) {1182 for (int c : cs) {1183 for (int t : ts) {1184 for (int s : series) {1199 for (int pixFormat : pixTypes) 1200 for (int x : xs) 1201 for (int y : ys) 1202 for (int z : zs) 1203 for (int c : cs) 1204 for (int t : ts) 1205 for (int s : series) 1185 1206 if ((c*s*3) <= 25) // IJ slider limitation 1186 {1187 for (boolean indexed : BooleanStates){1207 for (boolean indexed : BooleanStates) 1208 { 1188 1209 //System.out.println("indexed "+indexed+" format "+pixFormat+" x "+x+" y "+y+" z "+z+" c "+c+" t "+t+" s "+s); 1189 1210 colorCompositeTest(indexed,pixFormat,x,y,z,c,t,s); 1190 1211 } 1191 }1192 }1193 }1194 }1195 }1196 }1197 }1198 }1199 1212 } 1200 1213 … … 1321 1334 // throughout the stack. 1322 1335 1336 autoscaleTest(FormatTools.DOUBLE,false); 1337 autoscaleTest(FormatTools.FLOAT,false); 1323 1338 autoscaleTest(FormatTools.UINT8,false); 1324 1339 autoscaleTest(FormatTools.UINT16,false); … … 1327 1342 autoscaleTest(FormatTools.INT16,false); 1328 1343 autoscaleTest(FormatTools.INT32,false); 1329 autoscaleTest(FormatTools.DOUBLE,false);1330 autoscaleTest(FormatTools. FLOAT,false);1331 1344 1345 autoscaleTest(FormatTools.DOUBLE,true); 1346 autoscaleTest(FormatTools.FLOAT,true); 1332 1347 autoscaleTest(FormatTools.UINT8,true); 1333 1348 autoscaleTest(FormatTools.UINT16,true); 1334 1349 autoscaleTest(FormatTools.UINT32,true); 1335 1350 autoscaleTest(FormatTools.INT8,true); 1336 //autoscaleTest(FormatTools.INT16,true); // TODO in this case IJ via ShortProcessor::setMinAndMax() clamps the min value to 0 : bug due to obliviousness to sign?1337 1351 autoscaleTest(FormatTools.INT32,true); 1338 autoscaleTest(FormatTools.DOUBLE,true); 1339 autoscaleTest(FormatTools.FLOAT,true); 1352 autoscaleTest(FormatTools.INT16,true); // TODO in this case IJ via ShortProcessor::setMinAndMax() clamps the min value to 0 : bug due to obliviousness to sign? 1340 1353 1341 1354 /*
Note: See TracChangeset
for help on using the changeset viewer.