GithubHelp home page GithubHelp logo

Comments (5)

akoryagin avatar akoryagin commented on June 28, 2024 2

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.

jaysnanavati avatar jaysnanavati commented on June 28, 2024

Ping!

from radio.

roman-kh avatar roman-kh commented on June 28, 2024

@akoryagin, do you have any suggestions?

from radio.

jaysnanavati avatar jaysnanavati commented on June 28, 2024

Ping! It would be cool to get more insights and pointers into this, I am opening to contributing :)

from radio.

jaysnanavati avatar jaysnanavati commented on June 28, 2024

Thanks @akoryagin this looks promising, I will give it a shot! :)

from radio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.