Software at CIS : User Guide to lddmm-cardiac Matching, with examples

Overview

The lddmm-cardiac remote processing pipeline provides volume-based matching of a single template and target cardiac image. The pipeline resamples the target to the template resolution, performs landmark-based rigid matching of the target to template with global scaling, then performs LDDMM non-linear mapping. The determinants of the jacobian for both the forward and reverse transformation are calculated, as well as the momentum of the transformation.

Using CAWorks for lddmm-cardiac Matching

CAWorks is the preferred means for invoking the lddmm-cardiac remote processing. It performs many of the tasks of creating a remote processing data file with md5 sum, and sending it to the proper ftp site. It is also possible from caworks to generate the landmarks that are necessary for the lddmm-cardiac process.

Documentation for the caworks lddmm-cardiac functionality is in: CAWorks_cardiac_documentation.pdf.

lddmm-cardiac matching using ftp with examples

lddmm-cardiac can be invoked via ftp. The input file you transfer to the incoming ftp address will be routed to the icm cluster and processed.

For this example, the user will match the following template and target images

Template Image ES_JHU_Template

TemplateImage.zip

Template Mask ES_JHU_Template_LV_seg

TemplateMask.zip

Template Landmark ES_JHU_Template

ES_JHU_Template.lmk

Target Image patient1_t7_short_axis

TargetImage.zip

Target Mask patient1_t7_LV_seg_short_axis

TargetMask.zip

Target Landmark patient1_t7

patient1_t7.lmk

  • Create these files, with example contents as follows...
    • config.txt - configuration file.
        verbose=false
      • verbose - return intermediate processing outputs created by the lddmm-cardiac process
    • local_address.txt - contains the local name of the target.img and target.hdr files
      target.hdr patient1_t7_short_axis.hdr
      target.img patient1_t7_short_axis.img
      mask.hdr patient1_t7_LV_seg_short_axis.hdr
      mask.img patient1_t7_LV_seg_short_axis.img  
      target.lmk patient1_t7.lmk
      template.hdr ES_JHU_Template.hdr
      template.img ES_JHU_Template.img
      template_struct.hdr ES_JHU_Template_LV_seg.hdr
      template_struct.img ES_JHU_Template_LV_seg.img
      template_struct.lmk ES_JHU_Template.lmk
    • The matching target and template image and mask Analyze data (.img) and header (.hdr) files
    • The matching target and template landmark (.lmk) files
  • Rename the input data as follows:

    Original Name

    Rename To

    patient1_t7_short_axis.hdr

    target.hdr

    patient1_t7_short_axis.img

    target.img

    patient1_t7_LV_seg_short_axis.hdr

    mask.hdr

    patient1_t7_LV_seg_short_axis.img

    mask.img

    patient1_t7.lmk

    target.lmk

    ES_JHU_Template.hdr

    template.hdr

    ES_JHU_Template.img

    template.img

    ES_JHU_Template_LV_seg.hdr

    template_struct.hdr

    ES_JHU_Template_LV_seg.img

    template_struct.img

    ES_JHU_Template.lmk

    template_struct.lmk


    Or, in Linux:
    mv patient1_t7_short_axis.hdr target.hdr
    mv patient1_t7_short_axis.img target.img
    mv patient1_t7_LV_seg_short_axis.hdr  mask.hdr
    mv patient1_t7_LV_seg_short_axis.img mask.img
    mv patient1_t7.lmk target.lmk
    mv ES_JHU_Template.hdr template.hdr
    mv ES_JHU_Template.img template.img
    mv ES_JHU_Template_LV_seg.hdr template_struct.hdr
    mv ES_JHU_Template_LV_seg.img template_struct.img
    mv ES_JHU_Template.lmk template_struct.lmk
  • Compress the following files into tmp.zip...
    • identity.txt
    • config.txt
    • local_address.txt
    • mask.hdr
    • mask.img
    • target.hdr
    • target.img
    • target.lmk
    • template.hdr
    • template.img
    • template_struct.hdr
    • template_struct.img
    • template_struct.lmk
    $ zip tmp.zip config.txt identity.txt local_address.txt mask.hdr target.hdr target.lmk template.img template_struct.img mask.img target.img template.hdr template_struct.hdr template_struct.lmk # linux zip command
  • Calculate the md5 hash of tmp.zip. You have changed the identity.txt to contain your e-mail address, so your md5 sum will be DIFFERENT than the one below...
    $ md5sum tmp.zip
    29b72b7b18e932f7222e1cc88fc95387  tmp.zip
  • Rename tmp.zip to its md5 hash. This is your file for upload. Here is an example: 29b72b7b18e932f7222e1cc88fc95387.zip
    $ mv tmp.zip 29b72b7b18e932f7222e1cc88fc95387.zip
  • Login to the mristudio ftp server using your registered email for the password.
    $ ftp ftp.mristudio.org
    Connected to ftp.mristudio.org.
    220 Welcome to MRI STudio FTP service. -- Turn off Passive Mode.
    Name (ftp.mristudio.org:mbowers):  anonymous
    331 Please specify the password.
    Password:
    230 Login successful.
    Remote system type is UNIX.
    Using binary mode to transfer files.
  • Put your compressed folder on the queue
    ftp>  cd /pub/INCOMING/lddmm-cardiac/process-queue
    250 Directory successfully changed.
    ftp> put 29b72b7b18e932f7222e1cc88fc95387.zip
    local: 29b72b7b18e932f7222e1cc88fc95387.zip remote: 29b72b7b18e932f7222e1cc88fc95387.zip
    200 PORT command successful. Consider using PASV.
    150 Ok to send data.
    226 File receive OK.
    74416046 bytes sent in ...
  • You should receive an email with the subject "ICM lddmm-cardiac Processing: 29b72b7b18e932f7222e1cc88fc95387" informing you that your segmentation is being processed.
  • You should receive an email with the subject "lddmm-cardiac Process Complete: 29b72b7b18e932f7222e1cc88fc95387" informing you that your segmentation is complete.
  • Get your results from the mristudio ftp server.
    $ ftp ftp.mristudio.org
    Connected to ftp.mristudio.org.
    220 Welcome to MRI STudio FTP service. -- Turn off Passive Mode.
    Name (ftp.mristudio.org:mbowers): anonymous
    331 Please specify the password.
    Password:
    230 Login successful.
    Remote system type is UNIX.
    Using binary mode to transfer files.
    ftp> bin
    200 Switching to Binary mode.
    ftp> cd /pub/OUTGOING/lddmm-cardiac/output/lddmm-cardiac/29b72b7b18e932f7222e1cc88fc95387/
    250 Directory successfully changed.
    ftp> get Result.zip
    local: Result.zip remote: Result.zip
    200 PORT command successful. Consider using PASV.
    150 Opening BINARY mode data connection for Result.zip (508653324 bytes).
    226 File send OK.
    508653324 bytes received
    ftp> exit
    221 Goodbye.

Example results: :Result.zip

  1. Unpack your results from the zip file.
    $ unzip Result.zip 
    Archive:  Result.zip
      inflating: config.txt              
     extracting: identity.txt            
      inflating: local_address.txt       
      inflating: mask.hdr                
      inflating: mask.img                
       creating: output/
      inflating: output/lddmm_template.img  
      inflating: output/lddmm_template.hdr  
      inflating: output/lddmm_template_struct.img  
      inflating: output/lddmm_template_struct.hdr  
      inflating: output/rigid_target.img  
      inflating: output/rigid_target.hdr  
      inflating: output/rigid_mask.img   
      inflating: output/rigid_mask.hdr   
      inflating: output/defPatient.hdr   
      inflating: output/defPatient.img   
      inflating: output/Target2TemplateDetJacobian.vtk  
      inflating: output/Template2TargetDetJacobian.vtk  
      inflating: output/LDDMM_map_momentum.vtk  
     extracting: priority.txt            
      inflating: target.hdr              
      inflating: target.img              
      inflating: target.lmk              
      inflating: template.hdr            
      inflating: template.img            
      inflating: template_struct.hdr     
      inflating: template_struct.img     
      inflating: template_struct.lmk     

Example Data

Example Data for the ftp path to lddmm-cardiac is here: 29b72b7b18e932f7222e1cc88fc95387.zip. Please note that this zip file CAN NOT be used as is. Unzip the file, modify identity.txt with your MRI Studio registered e-mail address, the rezip as described above.

Results from the example data are here: Result.zip.

 

 

 

Last Modified: Friday, 22nd September, 2017 @ 11:49am