Importing images from path list

Very simple question here. I’m trying to add images to a project using the “From path list” option. My assumption here is that you write a text file with the file path of each image you’d like to import on different lines. It doesn’t seem to be adding any images so I’m wondering what I’m doing wrong?

No clue, never used it, but have you set it up as a standard QuPath file format string if you are using a Windows based system?
For example, in a script,
def dirOutput = buildFilePath("C:\\OAD\\Exports\\1\\")
will work but
def dirOutput = buildFilePath("C:\OAD\Exports\1\")
will not. I would give both a shot first just in case that might be it.

My file path is written in the following format:

C:\pathToFile\fileName

I tried using double backslashes and forward slashes but I get the same result. When I write the file path without the file name I want to import (the path to the folder containing the images), the path appears on the image path list but doesn’t import anything.

The goal here is that I want to create a project containing all tumor cores with necrosis. I’m planning on doing this by writing the file path of each image containing necrosis so that they can be imported together without having to individually add specific images from a folder containing >1000 images.

Not sure what is going on then. I just tested it for the first time, and imported two images from my demo project for the guide without any problems.

Text file contents.

C:\MyNewProjectFolder\MyImagesForAPortableProject\LuCa-7color_[13860,52919]_1x1component_data 2.tif
C:\MyNewProjectFolder\MyImagesForAPortableProject\LuCa-7color_[13860,52919]_1x1component_data 3.tif

The function seems to work, at least in the version I tested it on.

Log file for import:

INFO: VectraReader initializing C:\MyNewProjectFolder\MyImagesForAPortableProject\LuCa-7color_[13860,52919]_1x1component_data 2.tif
INFO: Reading IFDs
INFO: Populating metadata
INFO: Populating OME metadata
INFO: 
INFO: Saving project Project: QuPath example-project...
INFO: VectraReader initializing C:\MyNewProjectFolder\MyImagesForAPortableProject\LuCa-7color_[13860,52919]_1x1component_data 3.tif
INFO: Reading IFDs
INFO: Populating metadata
INFO: Populating OME metadata
INFO:

I’ve figured out what the problem was. Basically the images were named with .tif as an extension (image1.tif) so the file path needed to be entered in with an additional “.tif” at the end (pathToFile\image1.tif.tif) for it to work.

As always, thank you for your help again and trying to answer all my silly problems :slight_smile:

1 Like

Good! Just to make sure… the weirdness was in the original filenames, not QuPath requiring ‘double extensions’ - right?

Yes. The files were named with .tif at the end and of course they were also TIF file type so the full name + .tif needed to be written for the file path.

1 Like