SOCR EduMaterials AnalysesCommandLineVolumeKruskalWallis

From Socr

(Difference between revisions)
Jump to: navigation, search
(Created page with '== Analyses Command-Line - Volume-based Kruskal-Wallis Test== This page includes the information on how to access the [http://www.socr…')
(Analyses Command-Line - Volume-based Kruskal-Wallis Test)
 
Line 2: Line 2:
This page includes the information on how to access the [http://www.socr.ucla.edu/htmls/ana/TwoIndependentKruskalWallis_Analysis.html Kruskal-Wallis Analysis] library for the purpose of computing VOLUME/IMAGE test. Access is provided via shell-based command-line interface on local machines. More information about [[SOCR_EduMaterials_AnalysesCommandLine | other SOCR Analyses command-line interfaces is available here]].
This page includes the information on how to access the [http://www.socr.ucla.edu/htmls/ana/TwoIndependentKruskalWallis_Analysis.html Kruskal-Wallis Analysis] library for the purpose of computing VOLUME/IMAGE test. Access is provided via shell-based command-line interface on local machines. More information about [[SOCR_EduMaterials_AnalysesCommandLine | other SOCR Analyses command-line interfaces is available here]].
 +
 +
The technical details about the [http://wiki.socr.umich.edu/index.php/SMHS_NonParamInference#Kruskal-Wallis_Test Kruskal-Wallis Test are available on the SMHS EBook site].
=== Introduction===
=== Introduction===

Current revision as of 17:04, 1 February 2018

Contents

Analyses Command-Line - Volume-based Kruskal-Wallis Test

This page includes the information on how to access the Kruskal-Wallis Analysis library for the purpose of computing VOLUME/IMAGE test. Access is provided via shell-based command-line interface on local machines. More information about other SOCR Analyses command-line interfaces is available here.

The technical details about the Kruskal-Wallis Test are available on the SMHS EBook site.

Introduction

In addition to the graphical user interfaces, via a web-browser, all SOCR Analyses allow command-line shell execution on local systems.

General Usage

  • Get the latest SOCR JAR files from the SOCR page (http://socr.ucla.edu/htmls/jars/).
  • The command-line interface to SOCR Analyses generally uses EXAMPLE 1 from the list of example data files for the corresponding analysis.
  • All Input files are ASCII (see examples within each of the specific analyses).
  • a -h flag at the end of the command-line indicates that the first row in all ASCII input data files is a HEADER row (so it's not interpreted as data)
  • Number of variables can be indicated at the end (after -h flag). If no number of variables is specified, 3 is set as default.

Volume Kruskal-Wallis Test Usage

  • Generic Setting:

java -cp /ifs/ccb/CCB_SW_Tools/others/Statistics/SOCR_Statistics/bin/SOCR_core.jar:/ifs/ccb/CCB_SW_Tools/others/Statistics/SOCR_Statistics/bin/SOCR_plugin.jar edu.ucla.stat.SOCR.analyses.command.volume.Volume_KruskalWallisAnalysis -dm DesignMatrix.txt -h -factor FactorName -dim Zmax Ymax XMax [-p PValue_Filename] [-t KW_Stat_Filename] -data_type [0,1,2,3,4] -mask /ifs/tmp/myMaskVolume.img [-byteorder string]

  • Options:
    • -help: print usage
    • -dm [DesignMatrix.txt]: specify a tab-separated text file containing the design matrix. Note: Be careful with the construction of the design matrix ... The dm matrix file may need to be imported as an excel spreadsheet, first, and then recopied back to text edit using a PC/Windows machine. Mac and other platforms may introduce hidden characters (e.g., tab/return keys). So if you get an error like Beginning the stat analyses ... Volume Kruskal-Wallis Analysis Error!!!!!!!!!!!!!!, then please review your Design Matrix file. Missing values in the DM are indicated by "." Subjects with missing values in the factor variable (see factor) are not used in the analysis if this specific factor is selected for the analysis.
    • -mask [Mask-volume.img]: specify a mask-volume (0 or 1 intensities) restricting the voxels, where the regression models are computed (optional), 1 Unsigned-Byte Analyze format volume of the same dimensions as the data (intensity spectrum [0:255], all intensities >0 are consuiderd part of the mask and processed)
    • -h: DesignMatrix contains a header (first row)
    • -factor FactorName: specify which column/variable contains the levels of the single Factor
    • -dim Zmax Ymax XMax: specify the dimension-sizes (for 2D images use ZMax=1, for 1D, Zmax=Y_Max=1
    • -p [PValue_Filename]: output the p-value volume (enter only the base of the filename)
    • -t [KW_Stat_Filename]: output the approximated KW-Statistics indicating the strenght of the evidence to reject the Null hypothesis, no group differences between different levels of the Factor variable, (enter only the base of the filename). See F-statistics (F-maps) and Kruskal-Wallis Analysis.
    • -data_type [0,1,2,3,4]: Type=0 is for Unsigned Byte, Type=1 is for Signed Byte, Type=2 is for Unsigned Short Integer, Type=3 is for Signed Short Integer and Type=4 is for 4Byte=Float Volume Input;
    • -byteorder string: string is one of {big, little, other}.
      • big = BIG_ENDIAN processor
      • little = LITTLE_ENDIAN processor
      • other = default processor (java.nio.ByteOrder.nativeOrder())
    • -byteswap: (deprecated) Only enter this flag if you want the input data to be read in and byteswapped! Note that -byteswap effects : input data, mask-volume and output results!
      • A better alternative is to always swap bytes (if necessary) outside this program (e.g., %> dd conv=swab if=20088_jacobian.img of=20088_jacobian_BS.img).
    • Memory Use: Note that for some large file sizes, you may need to request more memory form the JVM. If your data is larger than 2003 then use these parameters after the initial java call (-ms1000m -mx2000m), see the example below. This requests 1-2GB or RAM memory for this process. You may need more or less memory depending on the number of volumes and dimension sizes.
  • Example: Edit a new file (Volume_KruskalWallis.csh) using any editor and paste this inside (make sure the file has executable permissions). Some operating systems/platforms may require variants of this (C-shell) script.

#!/bin/csh

date

java -ms500m -mx1000m -cp D:\Ivo.dir\Eclipse_Projects\SOCR2.6\jars\SOCR_core.jar;D:\Ivo.dir\Eclipse_Projects\SOCR2.6\jars\SOCR_plugin.jar edu.ucla.stat.SOCR.analyses.command.volume.Volume_KruskalWallisAnalysis -dm DM_KW.txt -h -factor GENDER -dim 220 220 220 -p P_Value_mask_KW -mask UC_mask_final8bit.img -t T_Value_mask_KW -data_type 2 -byteorder little

date

exit

Example Input data files

The design-matrix datafile must be provided as tab-separated ASCII/text file (DM.txt). The ASCII content of each of these files should follow the syntax below. Note that the first lines in these files are column headers. This requires the "-h" flag on the command line at execution so that these first lines are interpreted as column headers. The first two columns are the Subject Identifier and filenames for the corresponding imaging volumes, respectively. Columns 3 and on store the corresponding predictor variable (covariate) values. Typically there will be between 1 and 10 covariates. Note that as of March 2009, all covariates have to be numerical values - you can encode all string variables as numbers. For example, SEX can become 0(Male), 1(Female); and GROUP_ID can be 0(Normal), 1(MCI), 2(AD), as shown below.

SUBJECT_ID FILENAME SEX GROUP_ID AGE CDR MMSE
002_S_0413 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_002_S_0413.img 1 0 76.38 0 29
002_S_0559 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_002_S_0559.img 0 0 79.37 0 30
002_S_0729 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_002_S_0729.img 1 1 65.22 0.5 27
002_S_0954 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_002_S_0954.img 1 1 69.42 0.5 25
002_S_1018 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_002_S_1018.img 1 2 70.75 0.5 26
002_S_1070 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_002_S_1070.img 0 1 73.73 0.5 25
002_S_1261 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_002_S_1261.img 1 0 71.2 0 30
002_S_1268 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_002_S_1268.img 0 1 82.78 0.5 28
002_S_1280 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_002_S_1280.img 1 0 70.8 0 30
005_S_0324 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_005_S_0324.img 1 1 75.35 0.5 24
005_S_0448 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_005_S_0448.img 0 1 85.65 0.5 26
005_S_0553 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_005_S_0553.img 0 0 84.76 0 30
005_S_0572 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_005_S_0572.img 0 1 78.87 0.5 26
005_S_0602 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_005_S_0602.img 0 0 70.87 0 29
005_S_0814 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_005_S_0814.img 1 2 71.12 0.5 21
007_S_1206 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_007_S_1206.img 0 0 72.98 0 29
007_S_1222 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_007_S_1222.img 1 0 73.44 0 30
007_S_1304 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_007_S_1304.img 1 2 74.76 1 25
012_S_0689 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_012_S_0689.img 0 2 63.65 0.5 22
012_S_1009 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_012_S_1009.img 0 0 75.91 0 28
012_S_1212 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_012_S_1212.img 1 0 75.4 0 27
012_S_1292 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_012_S_1292.img 0 1 76.31 0.5 26
012_S_1321 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_012_S_1321.img 0 1 83.24 0.5 28
013_S_0996 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_013_S_0996.img 1 2 90.99 0.5 26
013_S_1035 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_013_S_1035.img 0 0 87.33 0 30
013_S_1276 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_013_S_1276.img 1 0 71.94 0 30
016_S_1117 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_016_S_1117.img 1 1 68.98 0.5 26
016_S_1121 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_016_S_1121.img 1 1 56.25 0.5 24
016_S_1138 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_016_S_1138.img 0 1 67.49 0.5 27
016_S_1149 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_016_S_1149.img 0 1 84.44 0.5 29
016_S_1326 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_016_S_1326.img 0 1 66.37 0.5 28
018_S_0335 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_018_S_0335.img 1 2 83.66 1 20
018_S_0369 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_018_S_0369.img 0 0 76.11 0 30
018_S_0406 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_018_S_0406.img 0 1 77.87 0.5 29
018_S_0450 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_018_S_0450.img 0 1 68.54 0.5 30
018_S_0633 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_018_S_0633.img 0 2 83.37 1 20
020_S_1288 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_020_S_1288.img 0 0 59.98 0 30
021_S_0332 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_021_S_0332.img 0 1 70.03 0.5 25
021_S_0753 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_021_S_0753.img 0 2 65.56 1 24
023_S_0030 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_023_S_0030.img 1 1 80.04 0.5 29
023_S_0031 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_023_S_0031.img 1 0 77.81 0 30
023_S_0058 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_023_S_0058.img 0 0 70.2 0 30
023_S_0061 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_023_S_0061.img 1 0 77.14 0 29
023_S_0078 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_023_S_0078.img 1 1 76.07 0.5 24
023_S_0139 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_023_S_0139.img 1 2 65.94 0.5 25
023_S_0331 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_023_S_0331.img 1 1 64.66 0.5 27
023_S_0376 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_023_S_0376.img 0 1 70.55 0.5 28
023_S_0388 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_023_S_0388.img 0 1 71.3 0.5 25
023_S_0604 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_023_S_0604.img 0 1 86.59 0.5 25
023_S_0613 /ifs/adni/3T/PERMS/IVO/JACOBIANS/3T_bl_023_S_0613.img 1 1 84.09 0.5 24

Supplementary information

Auxiliary tools

Masking statistical volumes

This tool provides the functionality to construct Masks of Stat Analysis results (e.g., P or T-stat maps outputted by VolumeKruskalWallis) given a user-specified threshold value. The output masks are 0 and 1 Byte volumes (determined by the threshold value).

  • Example call:

java -cp /ifs/ccb/CCB_SW_Tools/others/Statistics/SOCR_Statistics/bin/SOCR_core.jar:/ifs/ccb/CCB_SW_Tools/others/Statistics/SOCR_Statistics/bin/SOCR_plugin.jar edu.ucla.stat.SOCR.analyses.command.SplitMaskPositiveNegativeAnalysisResults -dim Zmax Ymax XMax -input filename -mask mask_filename -threshold Value [-below filename] [-above filename] -data_type [0,1,2,3,4] -byteorder little

  • Options:
    • -help: print usage
    • -mask [Mask-volume.img]: specify a mask-volume (0 or 1 intensities) restricting the voxels where the regression models are computed (optional), 1Byte Analyze format volume of the same dimensions as the data
    • -dim Zmax Ymax XMax: specify the dimension-sizes (for 2D images use ZMax=1, for 1D, Zmax=Y_Max=1
    • -below [Filename]: output mask of the intensities, where input <= threshold (1-Byte)
    • -above [Filename]: output mask of the intensities, where input < threshold (1-Byte)
    • -threshold [threshold_value]: threshold value separating the below/above intensities of the input file
    • -input [Filename]: input file-name
    • -data_type [0,1,2,3,4]:
      • Type=0 is for Unsigned Byte input volumes;
      • Type=1 is for Signed Byte input volumes;
      • Type=2 is for Unsigned-short integers
      • Type=3 is for Signed-short integers
      • Type=4 is for 4Byte=Float Volumes
    • -byteorder string: string is one of {big, little, other}.
      • big = BIG_ENDIAN processor
      • little = LITTLE_ENDIAN processor
      • other = default processor (java.nio.ByteOrder.nativeOrder())
    • -byteswap: (deprecated) Only enter this flag if you want the input data to be read in and byteswapped! Note that -byteswap effects: input data, mask-volume and output results!

References



Translate this page:

(default)

Deutsch

Español

Français

Italiano

Português

日本語

България

الامارات العربية المتحدة

Suomi

इस भाषा में

Norge

한국어

中文

繁体中文

Русский

Nederlands

Ελληνικά

Hrvatska

Česká republika

Danmark

Polska

România

Sverige

Personal tools