The text conversion

aspects of evaluating simulation results and their graphic presentation using either DisplayMICRESS or other software tools. Features and possibilities of DisplayMICRESS
Post Reply
Jane
Posts: 50
Joined: Tue Mar 29, 2022 1:06 pm
anti_bot: 333

The text conversion

Post by Jane » Thu Jun 16, 2022 10:23 am

Hello everyone,

I want to go from an experimental microstructure of a color picture (JPG) to a MICRESS microstructure input file, through the relevant manual I do the image processing, but when it comes to the last step to convert the picture to a microstructure text file I have The following questions, hope to get your help. ("Convert this PGM file to a MICRESS conform microstructure text file with the provided script tool PGM_to_MICRESS.exe
E.g. on the command line: PGM_to_MICRESS.exe <PGM file><microstructure.txt>”)
The problem shows up as: Can't run on my computer. What should I do? Or is there any other way to realize the transformation of microstructured text?

Jane

ralph
Posts: 167
Joined: Wed Apr 27, 2011 4:42 pm
anti_bot: 333

Re: The text conversion

Post by ralph » Fri Jun 17, 2022 9:52 am

Hi Jane,

sorry. I thought I had modified all documentation where a PGM_to_MICRESS.exe is mentioned.
Where did you read it?

In fact the provided PGM_to_MICRESS is a Perl script not an executable. We will port this to Python in future.
You need a to install a Perl interpreter to run it on Windows (e.g. Strawberry Perl). Linux distribution usually have one, already.

See here too: viewtopic.php?f=17&t=506&p=2012&hilit=perl#p1839

Hope that helps.
Best,
Ralph

Jane
Posts: 50
Joined: Tue Mar 29, 2022 1:06 pm
anti_bot: 333

Re: The text conversion

Post by Jane » Fri Jun 17, 2022 5:17 pm

Dear Ralph,

According to the link you sent, I have downloaded and installed the perl script, and then executed the following command, but it shows that access is denied, and the error behavior is the same as what I mentioned in my first forum. Whether the operation is compliant, so the output of the .txt file required in micress is still not implemented, I hope you can help me.

"C:\Users\a litter son jack&gt; Pgm_to_micress.exe D:\ [01] ustb\ [07] MICRESSstudy\ [18] Origin 4.pgm 4.txt
access denied."


Thank you again and wish you a happy life.
Jane

ralph
Posts: 167
Joined: Wed Apr 27, 2011 4:42 pm
anti_bot: 333

Re: The text conversion

Post by ralph » Mon Jun 20, 2022 10:52 am

I hope that you installed a perl interpreter. These packages include an exe like perl.exe. A perl script can be executed the way below. Please forget the PGM_to_MICRESS.exe and take the script (it is a text file) from the MICRESS tools folder. I think there is also a link in the other post.

Code: Select all

perl.exe PGM_to_MICRESS.pl Origin_4.pgm 4.txt
I noted here with the extension .pl which is the usual one for perl script. It remains a normal text file with perl code in it.
Hope that helps.

Best,
Ralph

shaojielv
Posts: 100
Joined: Thu Apr 01, 2021 2:16 pm
anti_bot: 333

Re: The text conversion

Post by shaojielv » Mon Jun 20, 2022 4:34 pm

Dear Ralph,

I have also been learning how to use the experimental data as the initial micro structure, I have saved the experimental pictures in.PGM format through the software GIMP, and I have downloaded the Perl interpreter according to the link you provided to other users, AND I have read the explanation you provided to other users, but I still don't understand it. If it is convenient, can you provide detailed steps for converting.PGM to micress-readable files? Thank you very much for your support.

lV

ralph
Posts: 167
Joined: Wed Apr 27, 2011 4:42 pm
anti_bot: 333

Re: The text conversion

Post by ralph » Mon Jun 20, 2022 5:03 pm

Sorry. There are not really more details.

* You have a PGM picture, the perl script (attached ) and a perl interpreter.
* You run it like above and you will get the 2D ASCII file with the pixel values in it which can be read in by MICRESS as an initial microstructure.
* the geometry (picture size) has to be specified in the driving file

See also our training material (Turorial 10a - Importing initial microstructures) to see how a 2D ASCII file can be read in:
https://micress.rwth-aachen.de/basic-tr ... 22.04.html

Best
Ralph
Attachments
PGM_to_MICRESS.txt
(3.28 KiB) Downloaded 126 times

Post Reply