SCIRun User Mailing List

Text archives Help


Re: [SCIRUN-USERS] [EXT]Re: Automating taking a snapshots from ViewScene.


Chronological Thread 
  • From: jess <jess@sci.utah.edu>
  • To: Douglas Todd <toddd@email.arizona.edu>
  • Cc: Petar Petrov <pip010@gmail.com>, scirun-users@sci.utah.edu
  • Subject: Re: [SCIRUN-USERS] [EXT]Re: Automating taking a snapshots from ViewScene.
  • Date: Fri, 17 Apr 2020 12:38:49 -0600

in SCIRun 4, the -i flag is needed to save an image on execute.  In SCIRun 5, you can save the output of the viewscene with the 3 matrix output ports.  each output is a color channel.  you seemed to have found that.  you’ve also found the bug with the reading matlab files using scipy (https://github.com/SCIInstitute/SCIRun/issues/1692).  We’re still working on a fix for that.

Is the text format solution working for now?

cheers,
Jess

On Mar 30, 2020, at 4:33 PM, Douglas Todd <toddd@email.arizona.edu> wrote:


Thank you very much for your help with this. This is scirun-5. Version v5.0-beta.x+Qt5.14.1 on Linux


Unfortunately, the -E flag is not saving the .png files for me. I am able to write out the R,G,B matrices to files and use a python script to combine them into an image. It turns out that I need to save the files as 'plain text' files, If I save them with a 'matlab' file type, python fails to read them, complaining about the data type.


Here's a test that illustrates the problem:

I've created a file called "MatlabGreen.mat", writing out the 'green' matrix from 'viewScene'. Executing the following python code gives:

import scipy.io
f=scipy.io.loadmat('MatlabGreen.mat')

     1 import scipy.io
----> 2 f=scipy.io.loadmat('MatlabGreen.mat')

/usr/local/lib/python2.7/dist-packages/scipy/io/matlab/mio.pyc in loadmat(file_name, mdict, appendmat, **kwargs)
    134     variable_names = kwargs.pop('variable_names', None)
    135     MR = mat_reader_factory(file_name, appendmat, **kwargs)
--> 136     matfile_dict = MR.get_variables(variable_names)
    137     if mdict is not None:
    138         mdict.update(matfile_dict)

/usr/local/lib/python2.7/dist-packages/scipy/io/matlab/mio5.pyc in get_variables(self, variable_names)
    270         mdict['__globals__'] = []
    271         while not self.end_of_stream():
--> 272             hdr, next_position = self.read_var_header()
    273             name = asstr(hdr.name)
    274             if name in mdict:

/usr/local/lib/python2.7/dist-packages/scipy/io/matlab/mio5.pyc in read_var_header(self)
    230         if not mdtype == miMATRIX:
    231             raise TypeError('Expecting miMATRIX type here, got %d' % mdtype)
--> 232         header = self._matrix_reader.read_header(check_stream_limit)
    233         return header, next_pos
    234

scipy/io/matlab/mio5_utils.pyx in scipy.io.matlab.mio5_utils.VarReader5.read_header (scipy/io/matlab/mio5_utils.c:5702)()

scipy/io/matlab/mio5_utils.pyx in scipy.io.matlab.mio5_utils.VarReader5.read_header (scipy/io/matlab/mio5_utils.c:5627)()

scipy/io/matlab/mio5_utils.pyx in scipy.io.matlab.mio5_utils.VarReader5.read_int8_string (scipy/io/matlab/mio5_utils.c:4752)()

TypeError: Expecting miINT8 as data type


However, Matlab correctly imports the file. I have a work-around for now.


Again, Thank you for your help.


Douglas Todd


On 3/30/20 10:10 AM, Petar Petrov wrote:

External Email

Hi Douglas,

is that for scirun 4 or 5?

With scirun4 it is easy, just a command line argument ( -E file_name)
It will automatically run and save the output to png for each window/viewscene.

not exactly sure if scirun5 supports it too!

On Sat, Mar 28, 2020 at 12:17 AM Douglas Todd <toddd@email.arizona.edu> wrote:
I am looking for documentation that allows me to take a snapshot of the
'ViewScene' window. I am running multiple invocations of SciRun using a
script and passing

parameters, and want to collect a series of images from the 'ViewScene',
one image for each invocation of SciRun.


Thank you for your help on this.


Douglas Todd






________________________________________________
SCIRun users mailing list:  scirun-users@sci.utah.edu
http://www.sci.utah.edu/software/scirun.html
To unsubscribe, email sympa@lists.sci.utah.edu with the "unsubscribe scirun-users" in the message body.

________________________________________________
SCIRun users mailing list:  scirun-users@sci.utah.edu
http://www.sci.utah.edu/software/scirun.html
To unsubscribe, email sympa@lists.sci.utah.edu with the "unsubscribe scirun-users" in the message body.




Archive powered by MHonArc 2.6.18.

Top of page