Comments (5)
Hey, @jaysnanavati!
Thank you very much for the issue and your interest!
True, RadIO
isn't originally built for supporting several image-channels. However, there is a workaround. The idea is to load channels one by one in images
-component, perform radio
-actions on it, and store the preprocessed channel in pipeline
-variable. In the end, the channels can be easily stacked together in another pipeline
-variable and used for model-training. This will look like
# assuming you store several channels of each input image in `dicom`
# the files are stored as follows:
# data_dir/file_1/channel_1.dcm`, `data_dir/file_1/channel_2.dcm;
# data_dir/file_2/channel_1.dcm`, `data_dir/file_2/channel_2.dcm, ...
fix = FilesIndex('data_dir/*', dirs=True)
ds = Dataset(fix, CTImagesMaskedBatch)
pipeline = (Pipeline()
.init_variables(['channel_1', 'channel_2', 'full_image'])
.load(fmt='dicom', src='channel_1.dcm') # an op that loads first channel
.some_action(...) # an op that might change images-component
.update_variable('channel_1', B('images')) # store `images`-comp in pipeline-variable
.load(fmt='dicom', src='channel_2.dcm') # an op that loads second channel
.some_action(...) # change second-channel in the same way
.update_variable('channel_2', B('images'))
.update_variable('full_image',
L(lambda im1, im2: np.stack([im_1, im_2], axis=-1),
V('images_1'), V('images_2'))) # stack 2 channels in pipeline-variable
... # ops with model-init
.train_model('model', feed_dict={'images': V('full_image'), # use the stacked image for training
'masks':...}))
You might benefit from reading about V, B, L
and other pipeline
-names expressions here.
Best,
Alex!
from radio.
Ping!
from radio.
@akoryagin, do you have any suggestions?
from radio.
Ping! It would be cool to get more insights and pointers into this, I am opening to contributing :)
from radio.
Thanks @akoryagin this looks promising, I will give it a shot! :)
from radio.
Related Issues (20)
- PyTorch HOT 2
- Batch size > 1 images with different dimensions HOT 9
- Gitter channel?
- Tutorial I: Error in preprocessing pipeline HOT 6
- Tutorial 4: how to predict masks use Keras3DUNet? HOT 3
- tqdm missing from requirements
- Preprocessing resize HOT 3
- AttributeError: Method 'fetch_nodules_info' has not been found in the CTImagesBatch class
- Pipeline will never stop as n_epochs=None HOT 2
- TypeError: only integer scalar arrays can be converted to a scalar index HOT 3
- get_nodules_pixel_coords showing no result except column names
- reading nifti files HOT 1
- How can I save it in JPG or PNG format
- TypeError("Can't mix strings and bytes in path components") HOT 2
- RadIO Tutorial 2 Creating mask issues
- Created Masks are not being resized
- How to predict a CT scan without nodules annotation
- (get_patches function) AssertionError: Failed in nopython mode pipeline (step: convert to parfors)
- tensorflow version 2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from radio.