2014-11-13 7 views
0

내가 공유하고 싶은 재미있는 ImageJ 스크립팅 문제가 있습니다. 영상 과학자는 13 'Z-stack'이미지로 258 시간의 데이터 세트를 제공합니다. 모두 함께 3,354 개의 티파니 이미지가 있습니다. 그는 imageJ 매크로 기록 기능을 사용하여 만든 매크로를 가지고 있으며, 매크로는 영원히 필요하지 않는 한 자신의 Windows 컴퓨터에서 작동합니다. 나는 매우 큰 학술 컴퓨팅 클러스터에 접근 할 수 있는데, 여기서 나는 시간 지점과 같은 많은 노드를 요구할 수 있다고 생각한다. 입력 파일은 'img_000000000_ZeissEpiGreen_000.tif'와 같은 레이블이 붙은 3,354 개의 티파니 이미지이고 9 자리 숫자는 1-258, 3 자리 숫자는 Z- 스택 순서 1-13이며 다른 입력 파일은 포인트 스프레드 함수 이미지입니다 sub-resolution에 작은 구슬로 만들었다. 다음은 매크로 "iterative_parallel_deconvolution.ijm"입니다. 클러스터에서 필요한 경로에 해당하는 경로를 변경했습니다.ImageJ를 사용하는 대형 클러스터에서 많은 시간 지점을 갖는 스크립팅 병렬 반복 deconvolution

//******* SET THESE VARIABLES FIRST! ******** 
path = "//tmp//images//"; 
seqFilename = "img_000000000_ZeissEpiGreen_000.tif"; 
PSFpath = "//tmp//runfiles//20xLWDZeissEpiPSFsinglebeadnoDICprismCROPPED64x64.tif"; 
numTimepoints = 258; 
numZslices = 13; 
xyScaling = 0.289 //microns/pixel 
zScaling = 10 //microns/z-slice 
timeInterval = 300; //seconds 
//******************************************** 

getDateAndTime(year1, month1, dayOfWeek1, dayOfMonth1, hour1, minute1, second1, msec); //to print start and end times 
print("Started " + month1 + "/" + dayOfMonth1 + "/" + year1 + " " + hour1 + ":" + minute1 + ":" + second1); 

//number of images in sequence 
fileList = getFileList(path); 
numImages = fileList.length; 

//filename and path for saving each timepoint z-stack 
pathMinusLastSlash = substring(path, 1, lengthOf(path) - 1); 
baseFilenameIndex = lastIndexOf(pathMinusLastSlash, "\\"); 
baseFilename = substring(pathMinusLastSlash, baseFilenameIndex + 1, lengthOf(pathMinusLastSlash)); 
saveDir = substring(path, 0, baseFilenameIndex + 2); 

//loop to save each timepoint z-stack and deconvolve it 
for(t = 0; t < numTimepoints; t++){ 
     time = IJ.pad(t, 9); 
     run("Image Sequence...", "open=[" + path + seqFilename + "] number=" + numImages + " starting=1 increment=1 scale=100 file=[" + time + "] sort"); 
     run("Properties...", "channels=1 slices=" + numZslices + " frames=1 unit=um pixel_width=" + xyScaling + " pixel_height=" + xyScaling + " voxel_depth=" + zScaling + " frame=[0 sec] origin=0,0"); 
     filename = baseFilename + "-t" + time + ".tif"; 
     saveAs("tiff", saveDir + filename); 
     close(); 

     // WPL deconvolution ----------------- 
     pathToBlurredImage = saveDir + filename; 
     pathToPsf = PSFpath; 
     pathToDeblurredImage = saveDir + "decon-WPL_" + filename; 
     boundary = "REFLEXIVE"; //available options: REFLEXIVE, PERIODIC, ZERO 
     resizing = "AUTO"; // available options: AUTO, MINIMAL, NEXT_POWER_OF_TWO 
     output = "SAME_AS_SOURCE"; // available options: SAME_AS_SOURCE, BYTE, SHORT, FLOAT 
     precision = "SINGLE"; //available options: SINGLE, DOUBLE 
     threshold = "-1"; //if -1, then disabled 
     maxIters = "5"; 
     nOfThreads = "32"; 
     showIter = "false"; 
     gamma = "0"; 
     filterXY = "1.0"; 
     filterZ = "1.0"; 
     normalize = "false"; 
     logMean = "false"; 
     antiRing = "true"; 
     changeThreshPercent = "0.01"; 
     db = "false"; 
     detectDivergence = "true"; 
     call("edu.emory.mathcs.restoretools.iterative.ParallelIterativeDeconvolution3D.deconvolveWPL", pathToBlurredImage, pathToPsf, pathToDeblurredImage, boundary, resizing, output, precision, threshold, maxIters, nOfThreads, showIter, gamma, filterXY, filterZ, normalize, logMean, antiRing, changeThreshPercent, db, detectDivergence); 
} 

//save deconvolved timepoints in one TIFF 
run("Image Sequence...", "open=["+ saveDir + "decon-WPL_" + baseFilename + "-t000000000.tif] number=999 starting=1 increment=1 scale=100 file=decon-WPL_" + baseFilename + "-t sort"); 
run("Stack to Hyperstack...", "order=xyczt(default) channels=1 slices=" + numZslices + " frames=" + numTimepoints + " display=Grayscale"); 
run("Properties...", "channels=1 slices=" + numZslices + " frames=" + numTimepoints + " unit=um pixel_width=" + xyScaling + " pixel_height=" + xyScaling + " voxel_depth=" + zScaling + " frame=[" + timeInterval + " sec] origin=0,0"); 
saveAs("tiff", saveDir + "decon-WPL_" + baseFilename + ".tif"); 
close(); 

getDateAndTime(year2, month2, dayOfWeek2, dayOfMonth2, hour2, minute2, second2, msec); 
print("Ended " + month2 + "/" + dayOfMonth2 + "/" + year2 + " " + hour2 + ":" + minute2 + ":" + second2); 

병렬 반복 역대 합을 플러그인 ImageJ에 대한 웹 사이트는 여기에 있습니다 : '은 qsub -l walltime = https://sites.google.com/site/piotrwendykier/software/deconvolution/paralleliterativedeconvolution 여기

내가이 명령으로, 클러스터에 작업을 전송하는 데 사용되는 PBS 스크립트입니다 24 : 00 : 00, nodes = 1 : ppn = 32 -q largemem ./PID3.pbs '. 나는 40 PPN까지 요청했지만 프로그램은 2

#PBS -S /bin/bash 
#PBS -V 
#PBS -N PID_Test 
#PBS -k n 
#PBS -r n 
#PBS -m abe 

Xvfb :566 & 
export DISPLAY=:566.0 && 

cd /tmp && 

mkdir -p /tmp/runfiles /tmp/images && 

cp /home/rcf-proj/met1/pid1/runfiles/* /tmp/runfiles/ && 
cp /home/rcf-proj/met1/pid1/images/*.tif /tmp/images/ && 

java -Xms512G -Xmx512G -Dplugins.dir=/home/rcf-proj/met1/software/fiji/Fiji.app/plugins/ -cp /home/rcf-proj/met1/software/imagej/ij.jar -jar /home/rcf-proj/met1/software/imagej/ij.jar -macro /tmp/runfiles/iterative_parallel_deconvolution.ijm -batch && 

tar czf /tmp/PIDTest.tar.gz /tmp/images && 

cp /tmp/PIDTest.tar.gz /home/rcf-proj/met1/output/ && 

rm -rf /tmp/images && 
rm -rf /tmp/runfiles && 

exit 

우리는 디스플레이 번호가 아닌 가짜 화면에 이미지를 보내는에서 ImageJ에 계속 Xvfb가를 사용해야의 전력해야한다고 수 있었다 임의적이다. 이 프로그램은 6 시간 동안 실행되었지만 출력 이미지를 만들지 않았습니다. 열린 이미지가 있어야했기 때문입니까?

이 매크로를 다시 디자인하여 각 시점을 분할하여 처리를 위해 자체 노드로 보낼 수 있습니다. 이 점에 대해 어떻게 생각하는지에 대한 아이디어가 있다면, 귀하의 의견에 진심으로 감사하게 생각합니다. 유일한주의 사항은 ImageJ에서 병렬 반복적 인 디콘 볼 루션 소프트웨어 플러그인을 사용해야한다는 것입니다.

고마워요! 당신은 당신이 ImageJ에에 포함 된 모든 GUI 호출을 담당하고 많은 사람들에 의해 테스트되었습니다 --headless 옵션을 사용할 수 있습니다 피지의 ImageJ에 발사기 (귀하의 경우 대부분 ImageJ-linux64)를 사용한다면 Xvfb의 사용에 관한

답변

2

, 클러스터 환경에서 ImageJ를 실행합니다.

이 방법을 사용하면 예를 들어 Google에서 생성 한 모든 출력을 볼 수도 있습니다. IJ.log()이 매크로를 호출 할 때, ImageJ를 호출하는 방법이 맞는지 확실하지 않습니다.

매크로 시작 부분에 setBatchMode(true)을 두는 것도 좋지만, --headless 모드에서 실행하면 차이가 있는지 확실하지 않습니다. 예 : 자세한 내용은 예제 BatchModeTest.txt을 참조하십시오.

클러스터에서 해당 내용을 실행하려는 경우 위키의 Fiji Archipelago 페이지에서 많은 세부 정보와이를 수행하는 방법을 확인할 가치가 있습니다.

건배 ~ Niko