• Views
  • Iteration Report
  • My Iteration Report
  •  
OMERO.server
  • Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • ← Previous Change
  • Next Change →

Changeset 1596 for branches/3.0-Beta2/components/romio/src/ome/io/nio/DeltaVisionHeader.java

Show
Ignore:
Timestamp:
06/05/07 20:08:58 (18 months ago)
Author:
david
Message:

DeltaVision? pixelbuffer testing unfinished

Files:
1 modified

  • branches/3.0-Beta2/components/romio/src/ome/io/nio/DeltaVisionHeader.java (modified) (6 diffs)

Legend:

Unmodified
Added
Removed
  • branches/3.0-Beta2/components/romio/src/ome/io/nio/DeltaVisionHeader.java

    r1578 r1596  
    22 
    33import java.nio.ByteOrder; 
     4import java.nio.CharBuffer; 
    45import java.nio.MappedByteBuffer; 
     6 
     7import ome.io.nio.utests.DeltaVisionTest; 
     8 
     9import org.apache.commons.logging.Log; 
     10import org.apache.commons.logging.LogFactory; 
    511 
    612/** 
    … …  
    5359        private String imageType; 
    5460 
     61        private transient static Log log = LogFactory.getLog(DeltaVisionHeader.class); 
     62 
    5563        /** 
    5664         * Constructor 
    … …  
    6169        public DeltaVisionHeader(MappedByteBuffer data, boolean endian) { 
    6270 
     71 
    6372                // make sure this is a header 
    6473                if (data.capacity() != IMAGE_HEADER_SIZE) { 
    … …  
    6776                } 
    6877 
     78                // set our data 
     79                this.data = data; 
     80 
    6981                // endianness 
    7082                if (isNative()) { 
     83                        data.order(ByteOrder.BIG_ENDIAN); 
     84                } else { 
    7185                        data.order(ByteOrder.LITTLE_ENDIAN); 
    72                 } else { 
    73                         data.order(ByteOrder.BIG_ENDIAN); 
    74                 } 
    75  
    76                 // set our data 
    77                 this.data = data; 
     86                } 
     87                 
    7888        } 
    7989 
    … …  
    91101         */ 
    92102        public int getImageCount() { 
    93                 return data.getShort(IMAGE_COUNT_OFFSET); 
     103                return data.getInt(IMAGE_COUNT_OFFSET); 
    94104        } 
    95105 
    … …  
    163173         */ 
    164174        public int getSizeZ() { 
    165                 return getImageCount() / getSizeC() * getSizeT(); 
     175                 
     176                int result = 0; 
     177                if (getSizeC() == 0) { 
     178                        result = getImageCount() / getSizeT(); 
     179                } else if (getSizeT() == 0) { 
     180                        result = getImageCount() / getSizeC(); 
     181                } else { 
     182                        result = getImageCount()/(getSizeT() * getSizeC()); 
     183                } 
     184                 
     185                return result; 
    166186        } 
    167187 

Download in other formats:

  • Unified Diff
  • Zip Archive

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/