SCIRun User Mailing List

Text archives Help


Re: [SCIRUN-USERS] Export/Import FieldsToMatlab


Chronological Thread 
  • From: Petar Petrov <pip010@gmail.com>
  • To: Jess Tate <jess@sci.utah.edu>
  • Cc: "scirun-users@sci.utah.edu" <scirun-users@sci.utah.edu>
  • Subject: Re: [SCIRUN-USERS] Export/Import FieldsToMatlab
  • Date: Mon, 14 Dec 2015 13:45:18 +0100

Hi Jess,

"ImportFieldsFromMatlab will work, but has a pretty strict structure requirement, which is unfortunately not match by the Exporter."
Exactly what I wanted someone to confirm because I found it really odd. Hope it will be fixed in 5.0

"However, there is a a matlab importer in the ReadField and an exporter in the WriteField that are more stable and usable, so you can try those."
Heh, I did expect they have native .mat support. Now I know, thanks.

"Otherwise, you can delete some of the extra fields in matlab, try with only node, cell/face, and field fields in the structure."
What I ended up doing, otherwise I had to repeat quite a manual work I've already done in matlab.

Just for the record, I created a new struct copying only the fields I want from the old (default) one.

This format worked out well:
struct.field
struct.face
struct.node

p.s. Another alternative I've used so far when it comes to importing geometry from matlab is to use the more generic: "ConvertMatrciesToMesh" where you only import matrices not fields from matlab.

Cheers all,
Petar

On Thu, Dec 10, 2015 at 11:35 PM, Jess Tate <jess@sci.utah.edu> wrote:
Hi Petar,

ImportFieldsFromMatlab will work, but has a pretty strict structure requirement, which is unfortunately not match by the Exporter.  However, there is a a matlab importer in the ReadField and an exporter in the WriteField that are more stable and usable, so you can try those.  Otherwise, you can delete some of the extra fields in matlab, try with only node, cell/face, and field fields in the structure.

cheers,
Jess



> On Dec 10, 2015, at 6:03 AM, Petar Petrov <pip010@gmail.com> wrote:
>
> Hello all,
>
> just wondering if this is well known behaviour or  bug,
> but when I use ExportFieldsToMatlab module (I set one field and rename struct name to ROI)
> then try to import the same .mat file with the module ImportFieldsToMatlab
> e get the error: Matrix 'ROI' cannot be translated into a SCIRun field (one of the dimensions of fieldedge needs to be of size 3)
>
> Am I missing something or those two modules are ultimately broken, since the same exported file without any modifications cannot be imported back?
>
> Thanks for your time,
> Petar




--
All the best,
Petar Petrov
http://ppetrov.net



Archive powered by MHonArc 2.6.18.

Top of page