Child pages
  • Disk cleanup after a registration

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
# remove all possible tmp directories:
> find /main/path/ -path '*_processed/*/tmp' -type d -exec rm -rf \{} \;
# on HPF, that could be one of the following:
> find /hpf/largeprojects/MICe/yourusername/ -path '*_processed/*/tmp' -type d -exec rm -rf \{} \;

Deep Cleaning

...

The file names are a little different with pydpiper 2.0, so the commands are slightly different.

Code Block
languagebash
#
# *_processed/*/resampled

# if you only want to keep the lsq6 and final nlin file:
for file in *_processed/*/resampled/*{__concat_lsq6_N_I_lsq6_lsq12_and_nlin-resampled.mnc,_N_I_lsq6_avg_lsq12-resampled.mnc}; do if [ -f $file ]; then rm -f $file; fi; done 

...

Code Block
#
# *_processed/*/masking/transforms

# This removes all the transforms used to register to the atlas for initial masking purposes
for file in *_processed/*/masking/transforms/*{mt_to_Dorr_2008_Steadman_2013_Ullmann_2013_on_NRXN1a_v1_average_lsq12,mt_to_Dorr_2008_Steadman_2013_Ullmann_2013_on_NRXN1a_v1_average_nlin_5}*; do if [ -f $file ]; then rm -f $file; fi; done

Deep Cleaning with Pydpiper 1

When you have analysed your data and are (relatively) sure that you're now done with your pipeline, there are a lot more files that can be deleted. If you follow these procedures, you will still keep the Jacobian determinants that you used for your analysis, the main transformations and the input files resampled into final non linear space. So you can easily still run more tests if you want to, or even reproduce files.

Code Block
languagebash
#
# *_processed/*/resampled
#
# The resampled directories contain a couple of files that you will definitely not need. The kind of 
# file that appear in these directories between Pydpiper 1 and 2 runs differ somewhat, but the following 
# command will work for either version.

#
# delete all masks, the "nuc" and "inorm" files in native space and the original file resampled to lsq6 space:
for file in *_processed/*/resampled/*{mask.mnc,0-resampled.mnc,_nuc.mnc,_nuc_inorm.mnc}; do if [ -f $file ]; then rm -f $file; fi; done 
 
# if you only want to keep the resampled-final-nlin.mnc files only, you can also remove the lsq6 and lsq12 files:
for file in *_processed/*/resampled/*{mask.mnc,0-resampled.mnc,_nuc.mnc,_nuc_inorm.mnc,_nuc_inorm_lsq6.mnc,-resampled-lsq12.mnc}; do if [ -f $file ]; then rm -f $file; fi; done 
Code Block
languagebash
#
# *_processed/*/stats-volumes
#
# By default the stats files that are created by a pipeline are the following:
# {relative/absolute} no blur (used to determine structure volumes
# {relative/absolute} fwhm 0.1
# {relative/absolute} fwhm 0.2
# {relative/absolute} fwhm 0.5
# {relative/absolute} fwhm 1.0
# Most likely you'll be using the Jacobians that have not been blurred and either the 0.2 or the 0.5 fwhm files.
# All the others can be safely removed. However, adjust which ones you want to remove from the next line:
for file in *_processed/*/stats-volumes/*{_fwhm0.1.mnc,_fwhm0.5.mnc,_fwhm1.0.mnc}; do if [ -f $file ]; then rm -f $file; fi; done 
Code Block
languagebash
#
# *_processed/*/transforms
#
# From all the transformations that are produced you only need to keep the:
# "inverse pure non linear" - used to calculate relative Jacobians
# "with additional inverted" - used to calculate absolute Jacobians
# "final nlin" - forward transformation that can be used to resample native files to final-nlin space
# the following can all safely be removed:
for file in *_processed/*/transforms/*{-final-nlin_inverse_grid_0.mnc,-final-nlin_inverse.xfm,-final-nlin_with_additional_grid_0.mnc,-final-nlin_with_additional.xfm,-final-nlin_inverted_grid_0.mnc,-final-nlin_inverted.xfm}; do if [ -f $file ]; then rm -f $file; fi; done 

Other cleaning:

Once your files are reconned/dist corrected, you can delete the original fid files. You can also delete the phase calibration folder, but given the small size of the procpar and global files, it's worth it to keep them in case we need them in the future.

...