Combining projects

Dear Qupath users,

I have a lot of images where I created annotations, these are saved in multiple projects. The reason for this was because we were working with multiple people and new images keep on coming. Now I would like to combine them all into one project, so that I can run a cell detection script for all the images in one batch. I did that before in Qupath version 0.1.2, where I created a new project containing all the images, and then I copied all the qpdata files in the project folder. This was easy as each datafile included the name of the image. In the newer milestones, the data files all have the same name (data.qpdata) and are in subfolders with the ID name (1, 2, 3, 4 etc.). I cannot just copy all the data folders in the new project because all the images have a different ID now. What I do now: I check which ID the image has in the new project, and copy only the data.qpdata file into the correct ID folder in the new project. This can be done, but I have a lot of projects and images. Does anyone know whether there is a more efficient way to do this? Thanks a lot.

Kind regards,

Tanya

With the caveat that you should probably backup things before trying anything new, here goes…

In v0.2.0-m11 you can create a new project, and import images from v0.1.2 projects by selecting the projects (File → Project… → Import images from v0.1.2.).

But note that the prompt inside the regular File → Project… → Add images command states ‘Drag & drop image or project files for import’. This means that you should be able to drag in a project.qpproj file from another v0.2.0 project and all the images will be copied over.

The intention of this was to make merging projects in v0.2.0 much easier than it ever was in v0.1.2.

3 Likes

That was actually really easy, I did not notice that you could also drag a project into the ‘add images’ prompt. Thank you very much Pete!

2 Likes

Well, it’s quite new and the documentation is lagging behind the features - glad it worked!

1 Like

Hello,

I’ve tried merging two QuPath files as described above in V0.2.0 and they will not merge together.
Is there another way to attempt this? I have also tried copying one file over so both files are on the same drive.

Thank you, Bobby.

Can you describe more precisely what you’ve tried, and what happened (including any error messages, or info under View → Show log)?

I have previously run pixel classification for spatial analysis on one file, and I now wish to overlay those files with another. I have copied both onto the same hard drive.

After using the drag and drop as described above QuPath states “WARN: Exception adding Image null” before stating “ERROR: Import images: failed to load one image”.

I have tried this a few times now, so the log shows this repeatedly.

If you are changing the location of the project before merging, you should first open each project and fix the image paths when prompted. See Projects — QuPath 0.2.3 documentation

If you try this first, does it work or what error do you see?

1 Like

I have double-checked the image path and everything is set to the same drive. The log shows the same “ERROR: Import images: failed to load one image” message.

Immediately after dragging and dropping into the main QuPath folder, it shows a quickly loading blue bar for 1/1 image.

Does that mean that both projects open fine independently, with the correct image?

I’m not certain what you mean by this.

I’d suggest creating two minimal projects on the same computer, and then trying to combine them using the exact steps outlined in Combining projects - #2 by petebankhead – preferably using an SVS file from Acknowledgements — QuPath 0.2.3 documentation

That should be the simplest case; if it does/doesn’t work that may help narrow down the possible ways it could be going wrong.

1 Like

Yes, apologies I should have been more clear. Both files open up fine independently and with the correct images.

I have tried a test run like this with a handful of my own images in two new and separate files and it appears to have worked! Although I can’t see why it didn’t work previously. I have now set the my main images to load from one project to another. Fingers crossed, thank you for the tips, hopefully it all goes to plan. Bobby.

1 Like