-
Notifications
You must be signed in to change notification settings - Fork 28
Home
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 had, usually through email, related to pnextract. Hope it helps others. Many thanks to those who provided the feedback. I will mention a list of people who helped me in the end, but please report any concerns you might have.
-
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.
-
I have added support for the .am -- Avizo native format -- for the two common
uncompressed unsigned short
and RLE encodedchar
data types. This is just to save time for those who use Avizo; this will be included in the next version of the code, please let me know if you need it so that I speed this up. -
.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 behavior 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 should 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=
symbol. 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.
-
There is no GUI for pnextract, for now, you have to run the code using
cmd
(see here, by typing the command:PATH_TO_APPS_BIN/pnextract.exe IMAGE.mhd
Well, you should replace PATH_TO_APPS_BIN
with the directory where the pnextract is located and the IMAGE
with the name of your input .mhd file.
Thanks to: Jacob Bensinger, Hongyang Wang