Xmipp

xmipp_image_convert (v3.0)

Usage

Convert among stacks, volumes and images, and change the file format. Conversion to a lower bit_depth automatically adjusts the gray level range. If it is between same bit depths and different sign, then only a histogram shift is done. If parameter --depth is not passed, then bit_depth is automatically chosen equal to or higher than input bit_depth. For stack output format, a selection file with the images in the stack is optionally created, replicating the labels of the input sel file. If output file extension is not set when --oroot is used (neither setting --oext nor :ext), then input format is chosen.

Parameters

-i, --input <input_file>
Input file: metadata, stack, volume or image. Supported read formats are:
  • dm3 : Digital Micrograph 3
  • jpg : JEPG img : Imagic
  • inf,raw : RAW file with header INF file
  • mrc, map : CCP4
  • ser : Tecnai Imaging and Analysis
  • spe : Princeton Instruments CCD camera
  • spi, xmp : Spider
  • tif : TIFF
  • raw#xDim,yDim,[zDim],offset,datatype,[r] : RAW image file without header file where datatype can be: uint8,int8,uint16,int16,uint32,int32,long,float,double, cint16,cint32,cfloat,cdouble,bool
--mode <mode=overwrite>
Metadata writing mode.
where <mode> can be:
  • overwrite Replace the content of the file with the Metadata
  • append Write the Metadata as a new block, removing the old one
--label <image_label=image>
Label to be used to read/write images.
-o, --output <output_file=>
Output file: metadata, stack, volume or image.
--oroot <root=>
Rootname of output individual images. Output image format can be set adding extension after rootname as ":ext".
--oext <extension=>
Output file format extension.
where <extension> can be:
  • img Imagic (Data types: uint8, int16, float* and cfloat).
  • inf RAW file with header INF file (Data types: (u)int8, (u)int16 and float*).
  • raw RAW file with header INF file (Data types: (u)int8, (u)int16 and float*).
  • mrc CCP4 (Data types: uint8, int16, float* and cfloat).
  • spi Spider (Data types: float* and cfloat).
  • xmp Spider (Data types: float* and cfloat).
  • tif TIFF (Data types: uint8*, uint16, uint32 and float).
  • jpg JPEG (Data types: uint8*).
  • custom <ext> Custom extension name, the real format will be Spider.
--type, -t <output_type=auto>
Force output file type.
where <output_type> can be:
  • auto Autodetect output type according to output extension and wheter --oroot is passed or not.
  • img Image
  • vol Volume
  • stk Stack

Bit options

--depth, -d <bit_depth=default>
Image bit depth.
where <bit_depth> can be:
  • default Default selected value (*)
  • uint8 Equivalent to uchar
  • int8 Equivalent to char
  • uint16 Equivalent to ushort
  • int16 Equivalent to short
  • uint32
  • int32
  • long
  • float
  • double
  • cint16 Complex int16
  • cint32 Complex int32
  • cfloat Complex float
  • cdouble Complex double
  • bool
--swap
Swap the endianess of the image file
--range_adjust, -r
Adjust the histogram to fill the gray level range
or --dont_convert
Do not apply any conversion to gray levels when writing in a lower bit depth or changing the sign

Stack options

--selfile_stack, -s
Create a selfile with the images of the output stack, keeping the rest of columns of the input selfile
--append, -a
Append the input to the output stack instead of overwriting it

Examples and notes

Put a selection file into a stack:
xmipp_image_convert -i list.sel -o images.stk
Convert a Spider volume to a MRC stack:
xmipp_image_convert -i spider.vol -o stack.mrcs -t stk
Create a stack of volumes with a Spider volume :
xmipp_image_convert -i spider.vol -o vol_stack.stk -t vol
Append a volume to a volume stack:
xmipp_image_convert -i spider.vol -o vol_stack.stk -a
Substitute a volume in a volume stack:
xmipp_image_convert -i spider.vol -o 3@vol_stack.stk
Save images in a stack as independent TIFF files in image directory with "newimage" basename in 8bit format:
xmipp_image_convert -i stackFile.stk -o tiffImages.sel --oroot images/newimage:tif -d uint8
Convert a selection file of 16bit TIFF images to 8bit and overwrites files and sel file:
xmipp_image_convert -i tiff16.sel -d uint8
Append a single image to a stack:
xmipp_image_convert -i img.spi -o stackFile.stk --append
Append a selection file to a stack:
xmipp_image_convert -i selFile.sel -o stackFile.stk --append
Replace a single image into a stack:
xmipp_image_convert -i img.spi -o 3@stackFile.stk

User's comments

%COMMENT{type="tableappend"}%