Posted by
Jim Peterson on
Feb 06, 2018; 2:18pm
URL: http://imagej.273.s1.nabble.com/Splitting-images-Histograms-tp5019997p5020009.html
Regarding 4):
The macro below may help get you going. This macro was written to split
nii files (MRI scans), but you can modify it for your lif files. It
prompts for a directory, finds all nii files and for each creates a
directory and populates it with the z-stack as separate tif files. The
individual file names are specified by the SequenceParams variable - in
this case ³Š/slice_zXXX, where XXX is the 3-digit stack index.
If you need to also separate the channels you will want to add
³split_channels² to the BioFormatsParams variable, but then you will need
to add logic to save the separate channel images, either putting them in
separate directories or modifying the name. I would recommend that you
try the split by hand before running the macro. Open one of your lif
files with bioformats and then save using "File/Save As/Image Sequenceв.
Good luck.
- Jim
The Jackson Laboratory
‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹
//
// This function expands an nii file into separate tif files, one per
z-layer
//
function split_nii(BaseDir, SampleName)
{
SampleFile = BaseDir + SampleName + ".nii";
DirName = BaseDir + SampleName;
BioFormatsParams = "open=" + SampleFile + " color_mode=Default
view=Hyperstack stack_order=XYCZT use_virtual_stack";
run("Bio-Formats Importer", BioFormatsParams);
File.mkdir(DirName);
SequenceParams = "format=TIFF name=slice_z digits=3 save=" + DirName;
run("Image Sequence... ", SequenceParams);
close();
}
//
// This function processes a directory of nii files.
// For each nii file a corresponding directory is created and
// populated with the tif files corresponding to the slices.
//
function ProcessDirectoryOfFiles(BaseDir)
{
write("Processing all nii files in directory: " + BaseDir);
FileList = getFileList(BaseDir);
for (i=0; i<FileList.length; i++)
{
if (endsWith(FileList[i], ".nii"))
{
write(" " + FileList[i]);
SimpleName = replace(FileList[i], ".nii", "");
split_nii(BaseDir, SimpleName);
}
}
write(" Done");
}
function main()
{
setBatchMode(true); // prevent the
image window
write("Select directory containing nii files..."); // Write a prompt
to the log window
BaseDir = getDirectory("."); // Pop up the file
select dialog
ProcessDirectoryOfFiles(BaseDir); // Process all nii
files in the directory
}
main();
‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹
On 2/5/18, 3:42 PM, "ImageJ Interest Group on behalf of csadangi"
<
[hidden email] on behalf of
[hidden email]> wrote:
>Hi,
>
>I have a few questions:
>1) I am using a Leica Confocal SP8 and the files are .lif. When I drag the
>experimental file to ImageJ, it opens up a console with warning (attached
>screenshot). Will it affect my images in any way?
><
http://imagej.1557.x6.nabble.com/file/t379887/1.gif>
>2) I also get a Bio-format option but I just click ok with the default
>settings. Should I change anything? (attached screenshot)
><
http://imagej.1557.x6.nabble.com/file/t379887/2.jpg>
>3) Once I open a series, it only shows up as blue in color. But while
>imaging, I used blue, green and red channels. How can I view them in their
>original channels?
>4) Is there a way to extract each image as a separate file using ImageJ? I
>took over 30 images and some z-Stacks, can I save them as individual
>files?
>
>5) I want to calculate the fluorescence intensity at the membrane. I
>found a
>paper describing the same but I am unclear as how to calculate the peak
>intensity. I have attached a screenshot for the same
><
http://imagej.1557.x6.nabble.com/file/t379887/3.jpg> .
>
>My specific questions are:
>a) How did they draw two lines in the image. I drew one line and clicked
>draw, but when I tried to draw the second line the first line disappeared.
>b) What do they mean by 2 values/line?
>c) How did they calculate the distance?
>d) Is the distance between peak 1 and peak 2 the fluorescence intensity?
>e) Should I just measure the center of the circle to calculate the
>intensity?
>The link to the complete paper is here:
>
https://elifesciences.org/articles/28270/figures>
>Thank you in advance for helping me.
>
>
>
>-----
>----
>Chinmaya
>Medical University Innsbruck
>Innsbruck
>Austria
>--
>Sent from:
http://imagej.1557.x6.nabble.com/>
>--
>ImageJ mailing list:
http://imagej.nih.gov/ij/list.html---
The information in this email, including attachments, may be confidential and is intended solely for the addressee(s). If you believe you received this email by mistake, please notify the sender by return email as soon as possible.
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html