def to_volume(self):
        """Return a 3D volume of the data"""
        if hasattr(self.header.definitions, "Lattice"):
            X, Y, Z = self.header.definitions.Lattice
        else:
            raise ValueError("Unable to determine data size")
        
        volume = self.decoded_data.reshape(Z, Y, X)
        return volume
def to_volume ( self ) : if hasattr ( self . header . definitions , "Lattice" ) : X , Y , Z = self . header . definitions . Lattice else : raise ValueError ( "Unable to determine data size" ) volume = self . decoded_data . reshape ( Z , Y , X ) return volume
Return a 3D volume of the data