-
Notifications
You must be signed in to change notification settings - Fork 29
pnextract FAQ
Welcome to the pnextract wiki. This wiki serves as a draft but complement to the files in the doc folder, and a place for answering miscellaneous questions about pnextract. Here I compile a list of questions and answers I exchanged by email related to pnextract; hope it helps others.
-
Copy the Image.mhd file from the doc folder as a reference for preparing the pnextract input file
-
Make sure that either
Paraview
orFiji is ImageJ
can open the .mhd file correctly before running gnextract. -
You can add the keyword
write_all true
in the input .mhd file (which is used as input header for the pnextract) so that you can visualize the results, especially the .vtu files, using Paraview and check that the dimensions of the network is what you expect. TODO: the visualization keywords deserves a better documentation -
The visualization can be done after extracting the code using the pnflow code as well.
-
The problem with .tif files is that the resolution in them is not always correct, and the unit is not known, so it's better add the correct resolution in the .mhd file; this is because the standard has not been designed for scientific data exchange. Anyway, the pnextract code will use the voxel size from the .mhd file and discard those in the .tif tags.
-
Alternatively, you can use the .raw format (ImageJ can save files in this format) or .raw.gz format (compress the raw files afterwards) if you want to save disk space. These formats are simpler and require you to put all the image information in the .mhd file.
-
If you use Avizo, then the recomended approach is to use Avizo native .am format for saving your image for use in libvoxel, pnextract or poreFoanm.
-
.tif and .am files are not part of the mhd format specification but VoxelImage and pnextract accept them.
-
.gz format is not automatically recognized in some versions of Paraview, you need to add the
CompressedData = True
keyword to force Paraview to accept it. This can be a cause of mistakes as you need to keep checking the consistency of this (here redundant) keyword.
-
VoxelImage and hence pnextract code tries to detect the unit based on the relative magnitude of the voxel size (um or m), so it will decide correctly in most cases about the unit of the data. But you can override this behaviour by adding a keyword in the .mhd file:
Unit = 1
. The voxel size should be given in meters if this keyword is set to 1. If it is in um, you can addUnit = 1e-6
. Either way, you can visualize the final network and the image file using Paraview and make sure the dimensions match each other. -
Note you see a mixture of keywords being used in the .mhd file. All those keywords which are separated by a
=
symbol from their data should be given before those which do not expect the=
character. You can use=
or:
to separate keywords from their data for all keywords, but this restriction still applies on the order of keywords. This is because Fiji and Paraview do not accept pnextract specific keywords. Also note that the order of the libvoxel keywords/commands is important.
- There is no GUI for pnextract, for now, you have to run the code using MS-Windows command prompt, called
PowerShell
orcmd
in older versions of Windows. - Double clicking on the executable is not the right way of running the code, as you will loose the outputs of the code in the message window which pops up.
- you can open
PowerShell
in the folder where your image file is by holding down Shift key and right-click in a folder, in Windows file explorer.
Finally, in the cmd window, opened in the directory where your micro-CT IMAGE is, type the command:
C:\TO\APPS\bin\pnextract.exe IMAGE.mhd
Of course, you should replace C:\TO\APPS\bin
with the directory where the pnextract is located and the IMAGE
with the name of your input .mhd file.
-
The network statistics can be generated using pnflow/poreflow codes. You may notice that the network statistics can change by changing the network extraction parameters or using a different network extraction code; you can view them simply as different discretizations of the void space except that here the network with more elements is not necessarily more accurate. Ideally you can do a careful sensitivity study and make sure that the physical properties (porosity, permeability and formation factors ...) are estimated correctly and that your choices for these parameters are optimum, but it is usually safe to stick to the default network extraction parameters.
-
When computing the network model statistics, use the volume-weighted approach see here as this approach effectively eliminates small disconnected pores which have little impact on flow properties but can significantly skew the "arithmetic" network statistics.
Jacob Bensinger, Hongyang Wang, He Kui for their feedbacks.
Please don't hesitate to contact me for any questions or comments at [email protected]