본문 바로가기
BT/Imaging analysis

Image j nuclear translocation measurement

by 르미르미 2023. 10. 28.

nuclear translocation measurement

 

96well plate 이용, 

B02~G11 까지 분석

 

각 well 당 fld1~9

 

red analysis - nucleus and cytosol

//알파벳 B에서 G까지 반복 (b,c,d,e,f,g = 66,67,68,69,70,71)
for (charCode = 66; charCode <= 71; charCode++) {
	//알파벳을 문자로 변환
	letter = fromCharCode(charCode);
	
	//숫자 2에서 11까지 반복
	for (number = 2; number <= 11; number++){
		//숫자를 두 자리로 표현한 문자열 생성
        if (number < 10) {
            formattedNumber = "0" + number;
        } else {
            formattedNumber = "" + number;
        }
		
		//이미지 파일 경로 생성
		route="E:/~~";
		//cell=letter+" - "+number;
		
		cell=letter+" - "+formattedNumber;
		
		//이미지 오픈, 분석
		for (i = 1; i < 10; i++) {
			open(route+cell+"(fld "+i+" wv 390 - Blue).tif");
			open(route+cell+"(fld "+i+" wv 475 - Green2).tif");
			open(route+cell+"(fld "+i+" wv 575 - Red).tif");
	
			// 이미지 처리 코드
			selectWindow(cell+"(fld "+i+" wv 390 - Blue).tif");
			run("Gaussian Blur...", "sigma=2");
			
			//Theshold 설정!
			setAutoThreshold("Default dark");
			run("Convert to Mask");
			run("Fill Holes");
			run("Watershed");
			
			//Nucleus size 설정
			run("Analyze Particles...", "size=80-250 exclude clear add");
			
            //green measurement
			selectWindow(cell+"(fld "+i+" wv 475 - Green2).tif");
			run("From ROI Manager");
			roiManager("measure");
			saveAs("Results", route+"Aexcel/"+cell+"-"+i+"-Green.csv");		
			close("Results");
			
            //red measurement - nucleus
			selectWindow(cell+"(fld "+i+" wv 575 - Red).tif");
			run("From ROI Manager");
			roiManager("measure");
			Table.renameColumn("Mean", "Nucleus");
			counts=roiManager("count");
			
            
            //red measurement - cytosol
			for(j=0; j<counts; j++) {
				roiManager("Select", j);
				run("Make Band...", "band=1");
				roiManager("Update");
				getStatistics(area, mean, min, max, std, histogram);
				setResult("Band", j, mean);
			};	
		
        	//data save
			saveAs("Results", route+"Aexcel/"+cell+"-"+i+"-Red.csv");
			close("Results");
			
			roiManager("Deselect");
			roiManager("Delete");
			
			close(cell+"(fld "+i+" wv 575 - Red).tif");
			close(cell+"(fld "+i+" wv 475 - Green2).tif");	
			close(cell+"(fld "+i+" wv 390 - Blue).tif");
				
		};

	}
}

댓글