/[escript]/trunk/pyvisi/py_src/datacollector.py
ViewVC logotype

Diff of /trunk/pyvisi/py_src/datacollector.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1028 by jongui, Thu Mar 1 04:57:31 2007 UTC revision 1029 by jongui, Wed Mar 14 05:01:13 2007 UTC
# Line 65  class DataCollector: Line 65  class DataCollector:
65    
66      def setData(self,**args):      def setData(self,**args):
67          """          """
68          Sets the data using <name>=<data> name-value pair. This sets the data          Create data using the <name>=<data> pairing. Assumption is made
69          tagged by <name> to the object <data>. It is expected that the          that the data will be given in the appropriate format.
         data is given in an appropriate source type.  
70          """          """
71    
72          if self.__source == Source.ESCRIPT:          if self.__source == Source.ESCRIPT:
# Line 81  class DataCollector: Line 80  class DataCollector:
80    
81      def setActiveScalar(self, scalar):      def setActiveScalar(self, scalar):
82          """          """
83          Specify the scalar field to load from the source file.          Specify the scalar field to load.
84    
85          @type scalar: String          @type scalar: String
86          @param scalar: Scalar field to load from the file.          @param scalar: Scalar field to load from the file.
# Line 102  class DataCollector: Line 101  class DataCollector:
101    
102      def setActiveVector(self, vector):      def setActiveVector(self, vector):
103          """          """
104          Specify the vector field to load from the source file.          Specify the vector field to load.
105    
106          @type vector: String          @type vector: String
107          @param vector: Vector field to load from the file.          @param vector: Vector field to load from the file.
# Line 123  class DataCollector: Line 122  class DataCollector:
122                            
123      def setActiveTensor(self, tensor):      def setActiveTensor(self, tensor):
124          """          """
125          Specify the tensor field to load from the source file.          Specify the tensor field to load.
126    
127          @type tensor: String          @type tensor: String
128          @param tensor: Tensor field to load from the file.          @param tensor: Tensor field to load from the file.
# Line 280  class DataCollector: Line 279  class DataCollector:
279    
280          return self.__output          return self.__output
281    
       
 ###############################################################################  
   
   
 from constant import ImageFormat  
   
 class ImageReader:  
     """  
     Class that defines an image reader.  
     """  
   
     def __init__(self, format):  
         """  
         Initialise the image reader.  
   
         @type format: String  
         @param format: Format of the image  
         """  
   
         self.__format = format  
         self.__vtk_image_reader = self.getImageReader()  
   
     def getImageReader(self):  
         """  
         Return the appropriate image reader based on the supplied image  
         format.  
   
         @rtype: vtkImageReader2 (i.e. vtkJPEGReader, etc)  
         @return: Image reader  
         """  
   
         if(self.__format == ImageFormat.JPG):  
             return vtk.vtkJPEGReader()    
         elif(self.__format == ImageFormat.BMP):  
             return vtk.vtkBMPReader()  
         elif(self.__format == ImageFormat.PNM):  
             return vtk.vtkPNMReader()  
         elif(self.__format == ImageFormat.PNG):  
             return vtk.vtkPNGReader()  
         elif(self.__format == ImageFormat.TIF):  
             return vtk.vtkTIFFReader()  
   
     def setFileName(self, file_name):  
         """  
         Set the image file name.  
   
         @type file_name: String  
         @param file_name: Image file name to be read  
         """  
   
         self.__vtk_image_reader.SetFileName(file_name)  
   
     def _getOutput(self):  
         """  
         Return the output of the image reader.  
   
         @rtype: vtkImageData  
         @return Image data  
         """  
   
         return self.__vtk_image_reader.GetOutput()  
   

Legend:
Removed from v.1028  
changed lines
  Added in v.1029

  ViewVC Help
Powered by ViewVC 1.1.26