MICALC(1)
β¨ NAME β¨
micalc β bestie, it does basic mathematics with data sets π
π DESCRIPTION π
micalc: does basic mathematics with data sets β¨
File formats are automatically identified by their file extension. For binary operations with two input files, the protocol of the first input file will be used for the output file. iykyk π«Ά
This program is part of odin 2.0.5 with configuration using_gcc debug gui(:5) standalone dl posix_threads libz gsl nifti vtk dicom png ismrmrd gdb
π micalc can be used in one of the following modes π
Binary operation with data sets and/or scalar numbers:
micalc [-if1 <input-file1> | -in1 <input-number1>] -op
<operation(+,-,*,/,min,max,lcorr,kcorr)> [-if2 <input-file2> |
-in2 <input-number1>] -of <output-file>
Accumulation/reduction of one data set:
micalc -if <input-file> -op
<operation(+,*,mean,median,stdev,min,max)>
Transformation (magnitude, logarithm, ...) of one data set:
micalc -if <input-file> -op
<operation(abs,sqrt,log,exp,-,/,acos)> -of <output-file>
Statistics of one data set:
micalc -if <input-file>
[-mean <time-mean-file>] [-stdev <time-stdev-file>] [-fluct
<relative-time-stdev-file>] [-tcourse <average time course of all
voxels>] [-hist <histogram> -histslots <numofslots> [-histmin
<minval>] [-histmax <maxval>] [-rightstairs] [-histfract]
[-loghist] [-histslotmap <file>]] [-cog <center-of-gravity-file>]
πΈ Extra options πΈ
-mask <Binary mask file: voxels with zeroes are discarded>β binary mask file, and yeah, voxels that are zero get thrown out ποΈ
π Protocol options π (these override parameters in input data, no cap)
-aaβ azimuthal rotation angle [deg] (default=0.0)-ahβ height rotation angle [deg] (default=0.0)-aiβ inplane rotation angle [deg] (default=0.0)-dateβ Date of scan [yyyymmdd] (default=20211015)-fpβ FOV in phase direction [mm] (default=220.0)-frβ FOV in read direction [mm] (default=220.0)-fsβ FOV in slice direction [mm] (default=5.0)-nrβ Number of consecutive measurements (default=1)-nxβ Number of points in read direction (default=128)-nyβ Number of points in phase direction (default=128)-nzβ Number of points in slice direction (default=1)-pbirthβ Patients date of birth [yyyymmdd] (default=00000000)-pidβ Unique patient identifier (default=Unknown)-pnameβ Full patient name (default=Unknown)-psexβ Patients sex (options=M F O, default=O)-psizeβ Patients size/height [mm] (default=2000.0)-pweightβ Patients weight [kg] (default=50.0)-rcnameβ Name of receive coil (default=Unknown)-scientβ Scientist Name (default=Unknown)-sdβ Inter-slice distance (from center to center) [mm] (default=10.0)-serdβ Series Description (default=Unknown)-sernoβ Series Number (default=1)-stβ Slice thickness [mm] (default=5.0)-studβ Study Description (default=Unknown)-tcnameβ Name of transmit coil (default=Unknown)-teβ Time-to-echo of the sequence [ms] (default=80.0)-timeβ Time of scan [hhmmss] (default=104600)-trβ Time between consecutive excitations [ms] (default=1000.0)
π File read options π (these get applied to input data before processing, bestie)
-cplxβ Treat data as complex and extract the given component (options=none abs pha real imag, default=none)-dsβ Dataset index to extract if multiple datasets are read-filterβ Read only those datasets which protocol parameter 'key' contains the string 'value' (given in the format 'key=value')-fmapβ For reduced memory usage, keep filemapping after reading (raw) data, but writing into the array will result in a crash
β οΈ fr fr, writing into the array after this will CRASH. Not a vibe. Don't do it. π
-framesplitβ Force splitting frames with different acquisition times into separate protocol-data pairs-ldrβ If multiple LDR (labeled data record) arrays are present, select this-rdialectβ Read data using given dialect of the format (default is no dialect)-rfβ Read format, use it to override file extension (options=autodetect 3db analyze asc coi dat dcm double float gz h5 hdr idx ima interfile jdx mag mhd nii ph png pos pro reg s16bit s32bit s8bit smp u16bit u32bit u8bit vtk xml xpro, default=autodetect)-skipβ Skip this amount of bytes before reading the raw data (default=0)
π¦ File write options π¦ (applied to output data after processing, periodt)
-appendβ Append to existing file, only for raw data-fnameparβ Space-separated list of protocol parameters to include when creating unique file names-noscaleβ Do not rescale values when storing integers-splitβ Force splitting of protocol-data pairs into separate files.-typeβ Image representation type (options=automatic float double s32bit u32bit s16bit u16bit s8bit u8bit, default=automatic)-wdialectβ Write data using given dialect of the format (default is no dialect)-wfβ Write format, use it to override file extension (options=autodetect 3db analyze asc coi dat dcm double float gz h5 hdr idx ima interfile jdx mag mhd nii ph png pos pro reg s16bit s32bit s8bit smp u16bit u32bit u8bit vtk xml xpro, default=autodetect)-wpβ Store the protocol separately to this file.
π§ Filters/processing applied to input file(s) and mask π§
Okay so these get applied in the exact order they appear on the command line. Order matters, bestie, don't play with it β¨
-align <filename,In-plane blowup factor (default=0)>β Align data to the geometry (voxel locations) of an external file-automask <skip leftmost slots (default=0),dump histogram,dump histogram fit>β Create binary mask using automatic histogram-based threshold-clusterβ Create clusters of non-zero adjacent/next-neighbours voxels, sorted by size-convolve <convolution kernel (default=noFunction) (Gauss NoFilter Triangle Hann Hamming CosSq Blackman BlackmanNuttall Exp ),full-width-at-half-maximum of kernel [mm] (default=0.0)>β Convolution in spatial dimensions-detrend <Number of low frequency components to be removed (default=5),Zero mean of resulting timecourse (default=No)>β Remove slow drift over time-dilate <radius of kernel [mm] (default=0.0)>β dilate image using spherical kernel as structuring element-edit <string in the format (timerange,slicerange,phaserange,readrange),value (default=0.0)>β Edit voxel values with range specified as single position, or 'all', or explicit range, optionally with increment (e.g. 1-10:3)-erode <radius of kernel [mm] (default=0.0)>β erode image using spherical kernel as structuring element-genmask <lower threshold (default=0.0),upper threshold (default=0.0)>β Create binary mask including all voxels with value in given range-invβ Invert image values, i.e. lowest to highest and vice versa-isotrop <voxelsize [mm] (default=0.0)>β make image voxels isotrop through interpolation (image geometry will not change), set to zero for minimum extent-lowpass <Cut-off frequency [Hz] (default=0.0)>β Lowpass filtering-max <Maximum value (default=0.0)>β Clip all values above maximum value-maxip <direction (time slice phase read none )>β Perform maximum intensity projection over given direction-mergeβ Merge datasets into a single dataset by expanding the time dimension-min <Minimum value (default=0.0)>β Clip all values below minimum value-minip <direction (time slice phase read none )>β Perform minimum intensity projection over given direction-noNaN <Replacement value (default=0.0)>β Replaces every NaN by the given value-nonzeromaskβ Create binary mask including all voxels with non-zero value-pflipβ Flip data in phase direction-prange <single position, or 'all', or explicit range, optionally with increment (e.g. 1-10:3)>β Select range in phase direction-proj <direction (time slice phase read none )>β Perform mean projection over given direction-quantilmask <quantil (default=0.0)>β Create binary mask including all voxels above the given fractional threshold-resample <new size (default=0)>β Temporal resize of image data-resize <slice-size (default=0),phase-size (default=0),read-size (default=0)>β Spatial resize of image data-reslice <requested orientation (default=coronal) (sagittal coronal axial )>β reslices the image to a given orientation-rflipβ Flip data in read direction-rot <angle [deg] (default=0.0),kernel size [pixel] (default=1.41421)>β In-plane rotation-rrange <single position, or 'all', or explicit range, optionally with increment (e.g. 1-10:3)>β Select range in read direction-scale <Slope (default=1.0),Offset (default=0.0)>β Rescale image values-sflipβ Flip data in slice direction-shift <readDirection shift [pixel] (default=0.0),phaseDirection shift [pixel] (default=0.0),sliceDirection shift [pixel] (default=0.0)>β Shift data spatially-slicetime <space-separated list of slice indices in order of acquisition>β Correct for different acquisition time points of slices-spheremask <Position string in the format (slicepos,phasepos,readpos),radius [mm] (default=0.0)>β Create binary spherical mask-splice <dimension of the data to be spliced (time slice phase read none )>β splices the image in the given direction-srange <single position, or 'all', or explicit range, optionally with increment (e.g. 1-10:3)>β Select range in slice direction-sum <direction (time slice phase read none )>β Perform sum projection over given direction-swapdim <[rps][-],[rps][-],[rps][-]>β swap/reflect/transpose dimensions by specifying a direction triple with optional reflection sign appended-tile <columns (default=0)>β Combine slices into a square 2D image-trange <single position, or 'all', or explicit range, optionally with increment (e.g. 1-10:3)>β Select range in time direction-tshift <time shift [frames] (default=0.0)>β Shift data in time-typemax <Datatype>β Clip all values above maximum of a specific datatype-typemin <Datatype>β Clip all values below minimum of a specific datatype-usemask <filename>β Create 1D dataset including all values within binary mask from file
π Other options π
-v <loglevel>or<component:loglevel>β for debugging/tracing all components or a single component, respectively. Possible values for loglevel are:0(noLog),1(errorLog),2(warningLog),3(infoLog),4(significantDebug),5(normalDebug),6(verboseDebug).-h,--help,-help,--versionβ Print help text or version information
π Supported file extensions(formats): π
3db(Iris3D binary data)
okay bestie, here's the rest of the roster β every single format it speaks, no skips, no "you get the idea" π
analyzeβ NIFTI/ANALYZE, withfsldialects in the mix β¨ascβ ASCII, and it rockstcoursedialectscoiβ JCAMP-DX data setsdatβ a Matlab ascii 2D data matrixdcmβ DICOM,siemensdialects and all π©»doubleβ double raw datafloatβ float raw datagzβ the GNU-Zip container that wraps other formats, a little nesting moment πh5β ISMRMRD Imagehdrβ Interfile, withneurostatdialectshdrβ NIFTI/ANALYZE, withfsldialects
not a typo bestie β hdr genuinely shows up twice, and the two entries are two totally different things. read the parenthetical. always read the parenthetical. π
idxβ 3D-indices of non-zeroes in ASCII,addvaldialects includedimaβ DICOM,siemensdialectsinterfileβ Interfile,neurostatdialectsjdxβ ODIN Image based on JCAMP-DX (Joint Committee on Atomic and Molecular Physical Data)magβ DICOM,siemensdialectsmhdβ MetaImageniiβ NIFTI/ANALYZE,fsldialectsphβ DICOM,siemensdialectspngβ Portable Network Graphics πposβ x-y positions of non-zeroes in ASCIIproβ ODIN protocols based on JCAMP-DX (Joint Committee on Atomic and Molecular Physical Data)regβ Ansoft HFSS ASCIIs16bitβ signed 16 bit raw datas32bitβ signed 32 bit raw datas8bitβ signed 8 bit raw datasmpβ JCAMP-DX data setsu16bitβ unsigned 16 bit raw datau32bitβ unsigned 32 bit raw datau8bitβ unsigned 8 bit raw datavtkβ Visualization Toolkit,vtkStructuredPointsxmlβ ODIN Image based on XML (Extensible Markup Language)xproβ ODIN protocols based on XML (Extensible Markup Language)
and that's the whole roster, bestie β signed, sealed, micalc 2.0.5, October 2021, page MICALC(1) π«Ά go convert something iconic π
π¦ where this page comes from
- debian bookworm: mitools 2.0.5-3+b1 Β· GPL-2.0-or-later
- debian trixie: mitools 2.0.5-7+b1 Β· GPL-2.0-or-later
- ubuntu jammy: mitools 2.0.5-2 Β· GPL-2.0-or-later
- ubuntu noble: mitools 2.0.5-5build4 Β· GPL-2.0-or-later
- ubuntu questing: mitools 2.0.5-7build1
- ubuntu resolute: mitools 2.0.5-8build2 Β· GPL-2.0-or-later
- ubuntu stonking: mitools 2.0.5-10build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms