imagej

Java for ImageJ. How to convert an image from RGB to 8 bit using code?

淺唱寂寞╮ 提交于 2021-02-08 04:07:39
问题 I am currently working on Connected Component Labelling. This is a process which takes an image and tells you how many separate objects are in the Image. My problem is that at the very start I need to be able to take any image (specifically RGB value) and convert it into 8-bit. EDIT: as in literally considered an 8bit, where the image is no longer recognised as RGB. Not an 8bit image that is recognised as an RGB. Is there a way using code to automatically do this without having to go into the

【短道速滑三】去除图像竖直(垂直)条纹算法

爷,独闯天下 提交于 2020-08-06 12:09:31
  最近一个朋友发了一个效果图,是关于条纹去除的,问我有没有什么好的方法,实现这个功能,给我的参考图片如下所示:   我这里提出两个解决方案: 方案1: 使用带通滤波器,基于FFT的,这个应该是最为标准的答案,详细的参考代码可以见ImageJ软件的BandPass Filer,具体路径为ImageJ\source\ij\plugin\filter\FFTFilter.java。界面如下所示:   得到的结果大概如下所示:  其原理就是竖直条纹在频谱图上表现为一条水平线,我们就要把这条水平线消除,反馈到RGB空间就没有条纹了。   上面的处理后的图像还有些模糊,原因是ImageJ这个插件对其他位置的频谱也处理掉了一些(上面有图的Filter除水平黑线之外的其他黑色区域),如果用于工业实践,可再次适当修改下代码。   在网上另外找了一个测试图像,效果也还算可以:   方案2: 使用GIMP里的Destripe算法,该算法位于gimp-master\plug-ins\common\destripe.c文件中,其核心过程其实也很简单,他接受一个输入参数,窗口宽度,在内部他计算指定宽度内,研图像高度方向所有像素的平均值,然后以这个平均值和当前像素的差异作为一个特征,带入到后续的一个增强算式中,核心就是下面两句代码,这个其实是用X方向的图像信息来弥补Y方向的信息的一种手段。 *c = (

使用Python对Dicom文件进行读取与写入

可紊 提交于 2020-04-20 16:58:52
Dicom文件的读取 Pydicom 单张影像的读取 一些简单处理 读取并编辑Dicom Tags 借助Numpy与PIL.Image 可视化 单张影像的写入 SimpleITK 单张影像的读取 序列读取 一些简单操作 边缘检测 可视化 单张影像的写入 Pydicom 单张影像的读取 使用 pydicom.dcmread() 函数进行单张影像的读取,返回一个pydicom.dataset.FileDataset对象. import os import pydicom # 调用本地的 dicom file folder_path = r "D:\Files\Data\Materials" file_name = "PA1_0001.dcm" file_path = os . path . join ( folder_path , file_name ) ds = pydicom . dcmread ( file_path ) 在一些特殊情况下,比如直接读取从医院拿到的数据(未经任何处理)时,可能会发生以下报错: raise InvalidDicomError ( "File is missing DICOM File Meta Information " pydicom . errors . InvalidDicomError : File is missing DICOM File

三维重建(三)-------------------(三维重建资料收集)

谁说胖子不能爱 提交于 2020-04-12 18:59:07
Major学者的个人主页汇总: 1.陈宝权: http://web.siat.ac.cn/~baoquan/ 2.南亮亮: http://web.siat.ac.cn/~liangliang/ 3.mueller: http://people.ee.ethz.ch/~pascmu/publications.html 4.Yasutaka Furukawa: http://homes.cs.washington.edu/~furukawa/ 5.肖建雄: http://mit.edu/jxiao/ 6.Peter Wonka: http://peterwonka.net/ 7.Jerry Talton: http://www.jerrytalton.net/ 6.3d-coform:http://www.3d-coform.eu/ 7.吴常常:http://homes.cs.washington.edu/~ccwu/------------提供了SFM可执行文件或源代码 8.计算机视觉中的多视图几何作者Visual Geometry Group: http://www.robots.ox.ac.uk/~vgg/ 领域的综述文献 城市三维重建:A Survey of Urban Reconstruction.pdf 源代码 ImageJ: http://imagej.nih.gov

Running Jython script from terminal with parameter

北慕城南 提交于 2020-02-04 05:04:06
问题 I want to invoke Jython scripts from command line, p.e. $ /Applications/Fiji.app/Contents/MacOS/ImageJ-macosx --headless little_jython_script.py I know about Python's (and therefore Jython's) capability to take parameters by import sys params = sys.argv[1:] and then calling the script with something like $ /Applications/Fiji.app/Contents/MacOS/ImageJ-macosx --headless jython_script_with_params.py param1 param2 param3 . However, according to to the ImageJ webpage http://imagej.net/Script

Find Edges with ImageJ Programmatically

人走茶凉 提交于 2019-12-31 02:54:30
问题 I want to use find edges option of the ImageJ , have the edges-found array and save it to another file programatically. ImagePlus ip1 = IJ.openImage("myimage.jpg"); ImageProcessor ip = new ColorProcessor(ip1.getWidth(), ip1.getHeight()); ip.findEdges(); However, the function findEdges is abstract and I can't have the edge-found image. EDIT: I wrote the following lines: ip.findEdges(); BufferedImage bimg = ip.getBufferedImage(); However, when I try to print out the RGB values of the

ImageJ API: Combining images

扶醉桌前 提交于 2019-12-25 18:25:10
问题 Using the ImageJ api, I'm trying to save an composite image, made up of several images laid out side by side. I've got code that loads ImagePlus objs, and saves them. But I can't figure how to paste an image into another image. 回答1: I interpret the problem as taking multiple images and stitching them together side by side to form a large one where the images may have different dimensions. The following incomplete code is one way of doing it and should get you started. public ImagePlus

ImageJ jar file plugin shortcut creation

心不动则不痛 提交于 2019-12-25 04:44:31
问题 I have been working on a developmental biology project marking various nuclear markers along with a DAPI stain to determine percentage of marker expression. I have found that the ImageJ plugin ITCN (http://rsbweb.nih.gov/ij/plugins/itcn.html) works great for each marker when also using the CLAHE program. My problem is that I have around 6000 images to analyze and I would love to be able to automate the process. I have recorded a macro such as the following (which can itself be looped to

ImageJ API: how to change the framerate when writing AVI

∥☆過路亽.° 提交于 2019-12-25 02:55:09
问题 I would like to use the AVI_Writer from the ImageJ API in my java program. However, even though I can automate the movie writing, I haven't found out how to change the framerate when using the method: writeImage(ImagePlus imp, java.lang.String path, int compression, int jpegQuality) Any idea? Thanks. 回答1: If you look at the menu command for saving as AVI, it has an option to set the frame rate, which is taken from a setting hidden in Image > Stacks > Tools > Animation Options... in the menu.