自迁移出 MediaWiki 以来,本页内容尚未经过审查。如果您愿意帮忙,请查看帮助指南!
|
|
|
| 类别 |
Registration |
SPIM可以对厚样本进行三维成像。除其他方法外,这可用于分析不同细胞类型深入组织的有效。由于间充质干细胞(MSC)在癌症治疗中的潜在作用,间充质干细胞(MSC)肿瘤侵袭是一个医学相关问题。
我们开发了一种“体外”筛选工具来分析MSC在不同条件下的较低深度因此潜力。,对具有肿瘤敏感性的MSC的模型球体进行成像,并估算其最接近深度。我们在这里介绍计算方法来处理我们的筛选筛选测定产生的数据量。
图像处理
使用光片显微镜进行高通量筛选会产生大量数据集,每个数据集都需要由一系列计算步骤组成的图像处理。每个步骤都非常运行,使得手动分析许多数据集效率低下。受到 Pavel Tomancak (Registration on cluster) 教程的启发,我们开发了一系列用于(半)自动化分析的 Linux shell这些脚本并不用于分析数据。请记住,这些脚本的脚本是快速编写的,因此不包含任何针对边界错误或与以下描述的不同数据组织的保护。请随意调整这些脚本以满足您的需求。请记住,不能保证这些脚本和由此生成的宏的功能不会出现错误。
准备工作
shell 脚本在 Linux 服务器(不是货物)上进行了测试,斐济安装包含 spim 注册插件。假设分析公开的垃圾邮件数据效果很好。Linux shell 脚本必须存储在 Linux 服务器上包含名为 Macros这里宏文件夹中,必须存在子文件夹“converter”、“fuse”和“register”。稍后您可以在这些子文件夹中找到各自生成的斐济宏。请删除小心不再用的宏,否则它们与新生成的宏相互干扰。宏的生成和命名是自动完成的。因此,名称可能相同,并且宏会相互覆盖。
# Basic commands:
# change directory
cd /path/to/folder
# show content of current directory
ls
# create subfolders: */
mkdir converter fuse register
# delete all data within current directory
rm *
组织数据
有效使用这些每个脚本的先决条件是以下数据组织:父文件夹(例如测量日一个文件夹)包含多个子文件夹,每个子文件夹仅包含一次测量的原始spim数据(例如control1、condition1、…)。这些子文件夹应全部位于同一级别(不进一步调用)。为了不将原始数据与计算数据混合在一起,必须首先启动一个shell脚本,为每个测量创建一个名为“convert”的子文件夹(见下文)。该文件夹位于原始垃圾邮件数据的文件夹下方。
满足
除了生成转换文件夹的脚本之外,还有两种其他类型的 shell 脚本:一种生成 fiji 宏列表,另一种自动依次执行该列表。
制作者 shell 脚本
生成宏的脚本需要两个命令行参数:第一个是父数据文件夹的完整路径和名称,第二个参数是整数(整数)。生成者脚本用于每个数据集生成一个斐济宏,并按数字升序命名。此数字顺序从 shell 开始启动脚本序列期间添加的第二个参数开始。这允许生成包含多个仅一个父目录的宏的宏列表。对于第二个父目录应该使用一个整数作为命令行参数,该参数大于命名第一个父目录的最后一个宏的整数。所有宏都存储在“converter”、“fuse”或“register”文件夹中之一(除了准备工作)。
#Example commands:
./1generate_convert_dir /path/to/data
./2convert_TIFFF_TIF_js /path/to/data 1
生成:
--- macros
| --- converter
| --- ...1.js
| --- ...2.js
| --- ...
执行器 shell 脚本
为了保持对数据处理的控制,制作者脚本生成的宏不会自动执行,从而使预检查成为可能。执行器脚本将以无头模式启动 fiji 并一一执行宏。因此,执行器宏不需要任何参数,它们执行存储在相应文件夹“converter”、“fuse”或“register”中的所有宏(参见准备工作)。
#Example command:
./3execute_convert_macro_js
shell 脚本的详细说明和来源代码
这些脚本交互构建,这意味着一个脚本的输出是下一个脚本的输入或先决条件。,脚本以升序标记,从而简化使用。
1生成_convert_dir
为了不将原始数据与计算数据混合在一起,我们为每个测量创建一个名为“convert”的子文件夹。该文件夹将位于包含原始垃圾邮件数据的子文件夹中。 1generate_convert_dir 自动在作为命令行参数给出的父文件夹下的所有文件夹中生成“convert”文件夹。指定父目录的完整路径和名称,但不指定第二个参数。
#.................................................................................
#generates a directory 'convert' in all subdirectories below the directroy given as the
#first parameter
#................................................................................
#!/bin/bash
echo "Start Macro"
Path="${1}"
echo ${Path}
ls -d ${Path}/* > dir
while read line
do
mkdir $line/convert
echo generated $line/convert
done < dir
#--------------------------------------------------------------------------------------
#executes the macros one after the other
# fiji --headless -macro /opt/Fiji.app/plugins/Macros/OpenSPIM_OME_TIFF_TIF_converter.ijm
# fiji --headless -macro /opt/Fiji.app/plugins/Macros/OpenSPIM_OME_TIFF_TIF_converter.ijm
# fiji --headless -macro /opt/Fiji.app/plugins/Macros/OpenSPIM_OME_TIFF_TIF_converter.ijm
#-------------------------------------------------------------------------------------
echo "End Macro"
2转换_TIFFF_TIF_js
Shell脚本生成fiji宏,执行垃圾邮件数据的pre-processing。指定数据的完整路径和每个数据目录的整数作为第二个参数(参见用法)。这些宏存储在文件夹“./macros/converter”中。
#!/bin/bash
echo "Start Macro"
Path="${1}"
resultmacro_number="${2}"
echo ${Path}
resultmacro=./macros/converter/
ls -d ${Path}/* > dirlist
while read line
do
echo 'importClass(Packages.ij.IJ);' > $resultmacro${resultmacro_number}.js
echo 'for (var a=0;a<=4;a++)' >> $resultmacro${resultmacro_number}.js
echo '{' >> $resultmacro${resultmacro_number}.js
echo 'var imp = IJ.openImage("'${line}'/spim_TL01_Angle" + a + ".ome.tiff");' >> $resultmacro${resultmacro_number}.js
echo 'imp.show();' >> $resultmacro${resultmacro_number}.js
echo 'IJ.saveAs("'Tiff'", "'${line}'/convert/spim_TL01_Angle" + a + ".tif");' >> $resultmacro${resultmacro_number}.js
echo 'imp.close();' >> $resultmacro${resultmacro_number}.js
echo '}' >> $resultmacro${resultmacro_number}.js
echo $resultmacro_number
let resultmacro_number=$resultmacro_number+1
done < dirlist
#.................................................................................
#generates a directory 'convert' in all subdirectories below the directroy given as the
#first parameter
#................................................................................
echo "End Macro"
3执行_convert_macro_js
执行2convert_TIFFF_TIF_js脚本生成的宏。处理后的数据存储将在原始数据文件夹下的“convert”子文件夹中。
#!/bin/bash
clear
echo "Start Macro"
ls -d ./macros/converter/* > macrolist
while read line
do
echo "start converting $line"
fiji $line
echo "end converting $line"
done < macrolist
#--------------------------------------------------------------------------------------
#executes the macros one after the other
# fiji /home/hh/programs/macros/converter/1.js
# .
# .
# .
# fiji /home/hh/programs/macros/converter/n.js
#-------------------------------------------------------------------------------------
echo "End Macro"
4生成_注册_宏
生成 fiji 宏的 Shell 脚本,对垃圾邮件数据执行 registration 操作。在使用此脚本之前,您必须根据各个实验的需要使用注册参数。指定数据的完整路径和每个数据目录的整数作为第二个参数(参见用法)。这些宏存储在文件夹“./macros/register”中。
#!/bin/bash
echo "Start Macro"
Path="${1}"
resultmacro_number="${2}"
echo ${Path}
resultmacro=./macros/register/
ls -d ${Path}/* > dirlist
while read line
do
echo $resultmacro_number
#generation of JavaScript macros starts here
echo "importClass (Packages.ij.IJ);" > $resultmacro${resultmacro_number}.js
echo "importClass (Packages.ij.ImagePlus);" >> $resultmacro${resultmacro_number}.js
echo "IJ.run('Bead-based registration', 'select_type_of_registration=Single-channel' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'select_type_of_detection=[Difference-of-Mean (Integral image based)] ' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'spim_data_directory=' +'"$line"'+'/convert/' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'pattern_of_spim=spim_TL0{t}_Angle{a}.tif' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'timepoints_to_process=' + '1' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'angles_to_process=' + '0-4' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'bead_brightness=[Advanced ...]' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'subpixel_localization=[3-dimensional quadratic fit (all detections)]' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'specify_calibration_manually xy_resolution=0.658 z_resolution=6.0' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'transformation_model=Affine' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'channel_0_radius_1=2' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'channel_0_radius_2=3' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'channel_0_threshold=0.004'" >> $resultmacro${resultmacro_number}.js
echo ");" >> $resultmacro${resultmacro_number}.js
#generation of JavaScript macro ends here
let resultmacro_number=$resultmacro_number+1
done < dirlist
#.................................................................................
#To run SPIM_registration type 'SPIM_registration Path_of_SPIM_Data'
#outpus are one Java Script macro pro subdirectory in 'Path_of_SPIM_Data' with name convention 'i.js' This macro register spim data in the rescpective directory
#start macros by typing fiji i.js
#................................................................................
5执行_注册_宏
执行4generate_register_macros生成的宏。
#!/bin/bash
clear
echo "Start Macro"
ls -d ./macros/register/* > macrolist
while read line
do
echo start converting $line
fiji $line
echo end converting $line
done < macrolist
#--------------------------------------------------------------------------------------
#executes the register macros one after the other
#-------------------------------------------------------------------------------------
echo "End Macro"
6生成_fusion_宏
生成 fiji 宏的 Shell 脚本,对垃圾邮件数据执行 fusion 操作。在使用此脚本之前,您必须根据各自实验的需要采用融合参数。指定数据的完整路径和每个数据目录的整数作为第二个参数(参见用法)。这些宏存储在文件夹“./macros/fuse”中。
#!/bin/bash
echo "Start Macro"
Path="${1}"
resultmacro_number="${2}"
echo ${Path}
resultmacro=./macros/fuse/
ls -d ${Path}/* > dirlist
while read line
do
echo $resultmacro_number
#generation of JavaScript macros starts here
echo "importClass (Packages.ij.IJ);" > $resultmacro${resultmacro_number}.js
echo "importClass (Packages.ij.ImagePlus);" >> $resultmacro${resultmacro_number}.js
echo "IJ.run('Multi-view fusion', 'select_channel=Single-channel' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'spim_data_directory=' +'"$line"'+'/convert/' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'pattern_of_spim=spim_TL0{t}_Angle{a}.tif timepoints_to_process=' + '1' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'pattern_of_spim=spim_TL0{t}_Angle{a}.tif' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'angles=' + '0-4' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'fusion_method=[Fuse into a single image]' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'process_views_in_paralell=All' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'blending' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'content_based_weights_(fast,' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'downsample_output=1' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'registration=[Individual registration of channel 0]' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'crop_output_image_offset_x=' + '0' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'crop_output_image_offset_y=' + '0' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'crop_output_image_offset_z=' + '0' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'crop_output_image_size_x=' + '0' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'crop_output_image_size_y=' + '0' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'crop_output_image_size_z=' + '0' + ' ' +" >> $resultmacro${resultmacro_number}.js
echo "'fused_image_output=[Save 2d-slices, all in one directory]');" >> $resultmacro${resultmacro_number}.js
#generation of JavaScript macro ends here
let resultmacro_number=$resultmacro_number+1
done < dirlist
#.................................................................................
#To run SPIM_registration type 'SPIM_registration Path_of_SPIM_Data'
#outpus are one Java Script macro pro subdirectory in 'Path_of_SPIM_Data' with name convention 'i.js' This macro register spim data in the rescpective directory
#start macros by typing fiji i.js
#................................................................................
7执行_fuse_宏
执行7execute_fuse_macros生成的宏。
#!/bin/bash
clear
echo "Start Macro"
ls -d ./macros/fuse/* > macrolist
while read line
do
echo "start fusing $line"
fiji $line
echo "end fusing $line"
done < macrolist
#--------------------------------------------------------------------------------------
#executes the register macros one after the other
#-------------------------------------------------------------------------------------
echo "End Macro"
入侵分析
这里实施的允许策略涉及球体和上部细胞的分割,即三维定位,并测量最低深度。与之前的图像处理步骤相比,以下宏直接在斐济用户界面内执行。这对分析进行第一手控制。
8bit转换_宏
Fiji 宏将融合的垃圾邮件数据转换为进一步分析所需的 8 位文件。该宏从每个“转换”文件夹中导入图像序列,把 8 位文件存储到新的输出目录中。在使用此脚本之前,您必须根据相应实验的需要采用比例参数。
input = "path\\to\\data\\"
output = "path\\to\\converted\\data\\"
function convert(input, output, filename) {
run("Image Sequence...",
"open=" + input + filename + "\\convert\\output\\img_tl1_ch0_z000.tif sort");
// set properties
run("Properties...",
"channels=1 frames=1 unit=um pixel_width=2.632 pixel_height=2.632 voxel_depth=2.632");
// set conversion scale
run("Brightness/Contrast...");
setMinAndMax(0, 30000);
call("ij.ImagePlus.setDefault16bitRange", 8);
run("8-bit");
// save .tif
index = lastIndexOf(filename, "/");
if (index!=-1) filename = substring(filename, 0, index);
saveAs("Tiff", output + filename );
close();
}
list = getFileList(input);
for (i = 0; i < list.length; i++)
convert(input, output, list[i]);
入侵分析_宏
斐济宏做细胞深度分析。球体和入侵细胞均被分割,并显示每个细胞到球体表面的最短距离。基于 3D 对象成分和 3D 管理器斐济插件进行分析。在使用此脚本之前,您必须根据各个实验的需要阈值参数进行分割。
input = "path\\to\\data\\";
output = "path\\to\\results\\";
// Thresholds for segmentation:
// spheroidThreshold = ;
// mscThreshold = ;
function distances(input, output, filename) {
// segmentation
open (input + filename);
run("3D Objects Counter", "threshold=spheroidThreshold slice=100 min.=80000 max.=45925560 surfaces");
selectWindow(filename);
run("3D Objects Counter", "threshold=mscThreshold slice=100 min.=400 max.=45925560 objects");
// distances
Objects = "Objects map of " + filename ;
Sphero = "Surface map of " + filename ;
run("3D Manager");
selectWindow(Sphero);
Ext.Manager3D_AddImage();
selectWindow(Objects);
Ext.Manager3D_AddImage();
Ext.Manager3D_Count(nb_obj);
for (i = 2; i < nb_obj-1; i++) {
Ext.Manager3D_Dist2(0,i,"c2b1",dist);
index = lastIndexOf(filename, ".tif");
if (index!=-1) filename = substring(filename, 0, index);
setResult(filename,i-2,dist);
}
// save results
run("Set Measurements...", " mean limit redirect=None decimal=0");
saveAs ("Results", output + filename + ".txt");
Ext.Manager3D_Close();
close(filename);
close(Sphero);
close(Objects);
}
list = getFileList(input);
for (i = 0; i < list.length; i++)
distances(input, output, list[i]);