Skip to content

Img2Data

Adrian Quintana edited this page Dec 11, 2017 · 1 revision

convert_img2data

(syntaxis changed as of version 1.2)

Purpose

This program applies a mask to a set of images. This set is given by a selfile. After applying the mask the result is storaged as a vector in the following format:


816 1000
-5.828e-01 -2.285e-01 -1.263e+00 -2.117e+00 -2.042e+00 -1.489e+00 -9.646e-01 -1 ...
-3.061e-02 -7.568e-01 -5.042e-01 +7.268e-03 +6.901e-01 +1.526e+00 +1.596e+00 +1 ...
-6.447e-01 -1.355e-01 -7.169e-01 -1.291e+00 -7.432e-01 -1.381e-01 +7.842e-01 +2 ...
-2.325e-01 -8.786e-02 -1.858e-02 -1.251e-01 -1.997e-01 +3.015e-02 -3.462e-02 -1 ...
-1.721e-01 -1.819e-01 -8.843e-01 -1.192e+00 -4.491e-01 +4.033e-01 +3.063e-01 -3 ...
...
-3.061e-02 -7.568e-01 -5.042e-01 +7.268e-03 +6.901e-01 +1.526e+00 +1.596e+00 +1 ...


The first line indicates the dimension of the vectors (in this case 816) and the number of vectors (in this case 1000). The rest of the lines are the feature vectors. Each line is a vector and each column is a vectors' component (pixels values inside the mask). If no mask is used (-nomask), then the whole image is used for generating the data file. The file name of the generated data file is stored by default in a file namedout.dat. To set a new name for this file, the (-o) parameter can be used.

The mask can be visually created using the XMask program.

This program is very important for the classification procedures, because it generates a set of feature vectors out of a set of images. The resulting data file can be used as input to any of the classification algorithms implemented in Xmipp

Usage


$ convert_img2data ...


Parameters

  • `` The input selection file name
  • `` The input mask file name
  • `` Output data file name. Default:out.dat
  • `` Indicates the no mask is going to be used. Default: mask is used
  • `` If used some messages are displayed in the output console. Default: used
  • `` The default is to apply the transformation stored in the header of 2D-images. Usedont_apply_geo to switch this off
  • `` Produce the radial average inside the mask instead of the pixel values themselves

Examples and notes


$ convert_img2data -i s0u.dat -mask mask.spi


In this example, all the images defined in the selection files0u.dat will be masked by the binary mask filemask.spi and their pixels values will be stored in theout.dat file.

To generate a set of images out of a data file, a similar program named data2img should be used.

--Main.AlfredoSolano - 24 Jan 2007

Clone this wiki locally