(Reader r, int size, float[] pixels)
| 142 | } |
| 143 | |
| 144 | void read(Reader r, int size, float[] pixels) throws IOException { |
| 145 | StreamTokenizer tok = new StreamTokenizer(r); |
| 146 | tok.resetSyntax(); |
| 147 | tok.wordChars(43, 43); |
| 148 | tok.wordChars(45, 127); |
| 149 | tok.whitespaceChars(0, 42); |
| 150 | tok.whitespaceChars(44, 44); |
| 151 | //tok.wordChars(33, 127); |
| 152 | //tok.whitespaceChars(0, ' '); |
| 153 | tok.whitespaceChars(128, 255); |
| 154 | //tok.parseNumbers(); |
| 155 | |
| 156 | int i = 0; |
| 157 | int inc = size/20; |
| 158 | if (inc<1) |
| 159 | inc = 1; |
| 160 | while (tok.nextToken() != StreamTokenizer.TT_EOF) { |
| 161 | if (tok.ttype==StreamTokenizer.TT_WORD) { |
| 162 | if (i==0) |
| 163 | firstTok = tok.sval; |
| 164 | pixels[i++] = (float)Tools.parseDouble(tok.sval, Double.NaN); |
| 165 | if (i==size) |
| 166 | break; |
| 167 | if (i%inc==0) |
| 168 | IJ.showProgress(0.5+((double)i/size)/2.0); |
| 169 | } |
| 170 | } |
| 171 | IJ.showProgress(1.0); |
| 172 | } |
| 173 | |
| 174 | } |
no test coverage detected