protected void initialize() throws IOException {
// get a raster manager builder
final RasterManagerBuilder rasterManagerBuilder=getRasterManagerBuilder();
if(rasterManagerBuilder==null){
throw new IOException("Unable to obtain a RasterManagerBuilder");
}
//
// Tell underlying implementation that we are starting to process
//
startWalk();
//
// Stream metadata
//
// now parse the stream metadata
if(rasterManagerBuilder.needsStreamMetadata()){
rasterManagerBuilder.parseStreamMetadata(getStreamMetadata());
}
//
// Main Loop on each image
//
// now start parsing metadata plus other info for each image we have
final int numSteps=getNumElemements();
for(int i=0; i<numSteps; i++){
prepareElement(i);
try{
rasterManagerBuilder.addElement(i,acquireReader(i),getSource(i));
} finally {
releaseReader(i);
}
}
//
// Release Resources
//
endWalk();
//
// Create raster managers
//
this.elements=rasterManagerBuilder.create();
rasterManagerBuilder.dispose();
}