SCIRun User Mailing List

Text archives Help


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


Chronological Thread 
  • From: Douglas Todd <toddd@email.arizona.edu>
  • To: jess <jess@sci.utah.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: Sat, 18 Apr 2020 07:50:12 -0700
  • Autocrypt: addr=toddd@email.arizona.edu; prefer-encrypt=mutual; keydata= xsFNBFgBOUABEADC4+pXHXyCHEyaea8ou/OLn7ZDR+Q9qT0vCbWCPbVk8Qbx0K7OZEo2XnWu 41qgdxKaSJLL0M5KTFJ8Nq20IjroDZeqmHwziYRBvd6tCZ2mgCOaqRhWoAWkH+w40c39yDXo frK9ucvJRLLbRiUTf4QViDzoCuzXRcXu3G9eLq+wEB3TUpg7prZWgcROkwI7877f9mYNekfc rBmoRL9d72c2RpKrnhaZa0MjZUqfc2I1fJke3iWyNs3PIlwvmL3wAILaO/t7ONzYeU/wirlf xIc9oZB7D/Aj9guWePHZq34KneQ+qm8w68sc0CUqA9mpdA68+PU0XYXXdGKXQ9w7hdmZun3o 89aoergFXGYhop0tN1lqaA3ibPSSzXeGXyGmIxgDrtsKmh+eGBXwWpYXTQnbKNIB4s2oh7CT moYhH6rbaEHtYlXrmDp36M/Glcs6xBUARArFOAPoRxgusSxZTdtGCMww0RdmGQDqjLfXgGnT D3syVQ5LkJA83Ob5E4NfnpfjdjlH6ZJmtGy0kzVMXdcCuxbRlGBeR5EBNP9c0VN+x8YROKEG dW0K6IfijgmNCoTWbdJrqilUeYIWn3Z8vaIH8FoieSUxCr5APqw1HtTfSrpgwZQ1h9S3EN5+ dHgZQM12HRgqPmwiXaTUkjFOcYzINZfBN0nC3u9l6O3CcjCggQARAQABzR9Eb3VnbGFzIFRv ZGQgPGtlN2d5cUBnbWFpbC5jb20+wsF9BBMBCAAnBQJYATlAAhsjBQkJZgGABQsJ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o+Kr1OCxrbifLKHZXck9D+tIvzVc8e YzaM

Thank you Jess,

I did discover  the RGB matrices that viewscene outputs and have used them to create movies as I change input parameters to the simulation. It turns out that there is a work-around for collecting field data in python. You can instantiate a python interface object, and then 'pickle' a field object that is passed into the python object. This allows you to save field data in a python readable format.


Take care.


Doug



On 4/17/20 11:38 AM, jess wrote:

External Email

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