Using Labels with transformed imagedatastore in 3d CNN.

I am trying to preprocess (crop and resize) 3d medical imaging data using imagedatastore (with handle, niftiread) and transform datastore with a custum function (using imcrop3 and imresize3). The transformed datastore does not supply the labels when trying to train the network. How can I include them? Using 2019b.

 Accepted Answer

Hi,
To transform the datastore you can use the augumentedImageDatastore function. This not only supply label information but also more flexibility with optional preprocessing.
Hope this helps!

5 Comments

Hi, thanks for replying.
My problem with augmentedImageDatastore is that I cannot provide custom functions to the imageDataAugmenter. My understanding is that it will only let me use predefined functions like rotate or translate. Is it possible to create custom functions within imageAugmenterDatastore that could handle multiple global funtions like imresize3 and centerCropWindow3? Another problem is that augmentedImageDatastore require you to specify outputsize in two dimensions, but won't that cause a problem when handling 3d or 4d data?
Thank you in advance!
Have you solved this problem?
Unfortunately, no. I omitted the problem by preprocessing and loading the data manually. But if it could become a feature in future versions it would be great. I unfortunately haven’t tested the newest versions of Matlab, so it might already be implemented.
oh. I use R2020a, and it still does not have that feature. I solved this yesterday by creating a combined datastore - one datastore the is "transformed datastore", and the other one is a data of "categorical cell arrays" where this datastore contains the labels in the same order.
Great, thanks. I am currently not able to test this, but I’ll mark the thread as solved anyway.

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!