Closed erjel closed 2 years ago
Hi Eric,
This one is a bit tricky, since we would be mixing 2D and 3D ROIs. Here are some (imperfect) options:
(1, h, w)
. Everything is still treated as a 3D volume, but you get only a single slice. With RandomLocation
, this will select a random z
section, which I assume is what you want. Use Squeeze
and Unsqueeze
to get the arrays in the right shape (e.g., if you train with torch.Train
, you probably need a batch and channel dimension anyway).prepare()
for each array request in it. Undo the same in process()
, i.e., take each array, assert that the z
dimension is of size 1, squeeze the array .data
and update its .spec
to be 2D.z
index. Create as many of those source nodes as you have z
sections (sources are lightweight, but if you have many z
sections this might still cause some overhead). Add a RandomProvider
after the sources to select a random z
section on each request.I would recommend option 1, i.e., treat everything as 3D, one section thick.
Hi Jan,
thank you for the quick response!
I tried the first option, but I have the problem that the z dimension is considered a spatial coordinate (c, x, y, z) and therefore I can not use Squeeze
.
I went for the 2. option and created a general ReduceDim
node. I will test how much of an overhead this will create and how far I can go from here.
Eric
Hi,
I have a question: Is there an option to drop a spatial dimension in a pipeline? Currently I have 3D volume (c, x,y,z) and would like to extract random (x,y) slices. I figured, that something like:
Would probably work, but I get the error message:
So I am stuck here and would appreciate any help....
Eric