volumeRendering.js
// insert the slice at the z index location.
insert the slice at the z index location.
insert the slice at the z index location .
insertSlice(pixels, index){
        const datasetDefinition = this.imageData.get('extent', 'spacing', 'origin');
        let scalars = this.imageData.getPointData().getScalars();
        let increments = this.computeImageDataIncrements(1); 
        let scalarData = scalars.getData();
        let indexXYZ = [0,0,index];
        let pixelIndex = 0;
        for (let row = 0; row <= datasetDefinition.extent[3]; row++)
        {
            indexXYZ[1] = row;
            for (let col = 0; col <= datasetDefinition.extent[1]; col++)
            {
                indexXYZ[0] = col;
                {
                    let destIdx = this.computeIndex(datasetDefinition.extent, increments, indexXYZ);
                    scalarData[destIdx] = pixels[pixelIndex++];
                }
            }
        }
        this.imageData.modified();
    }
insertSlice ( pixels , index ) { const datasetDefinition = this . imageData . get ( 'extent' , 'spacing' , 'origin' ) ; let scalars = this . imageData . getPointData ( ) . getScalars ( ) ; let increments = this . computeImageDataIncrements ( 1 ) ; let scalarData = scalars . getData ( ) ; let indexXYZ = [ 0 , 0 , index ] ; let pixelIndex = 0 ; for ( let row = 0 ; row <= datasetDefinition . extent [ 3 ] ; row ++ ) { indexXYZ [ 1 ] = row ; for ( let col = 0 ; col <= datasetDefinition . extent [ 1 ] ; col ++ ) { indexXYZ [ 0 ] = col ; { let destIdx = this . computeIndex ( datasetDefinition . extent , increments , indexXYZ ) ; scalarData [ destIdx ] = pixels [ pixelIndex ++ ] ; } } } this . imageData . modified ( ) ; }
insert the slice at the z index location.
insert the slice at the z index location .
// TODO number of components.