Monai Attribute

Debasish_Samal: <p>Hello everyone,<br>
I was trying to import some attributes from <code>monai.transform</code> but while importing <code>AddChanneld</code> the jupyter notebook was showing the error of:</p>
<p><code>module 'monai.transforms' has no attribute 'AddChanneld''</code></p>
<p>this was the code I used importing:</p>
<pre><code class="lang-auto">from monai.transforms import(
    Compose,
    AddChanneld,
    LoadImaged,
    Resized,
    ToTensord,
    Spacingd,
    Orientationd,
    ScaleIntensityRanged,
    CropForegroundd,
)
</code></pre>
<p>I also tried an alternate method where I imported the file: <code>import monai.transforms as tf</code></p>
<p>and use the method:  <code>tf.AddChanneld(keys=["vol", "seg"]</code></p>
<p>What am I doing wrong?</p>

emre_onal: <p>Try using EnsureChannelFirstD(channel_dim=“no_channel”) instead. addchannel is removed from the library but it still exists in tutorials and many places.</p><aside class="onebox githubissue" data-onebox-src="https://github.com/Project-MONAI/MONAI/issues/6280">
  <header class="source">

      <a href="https://github.com/Project-MONAI/MONAI/issues/6280" target="_blank" rel="noopener nofollow ugc">github.com/Project-MONAI/MONAI</a>
  </header>

  <article class="onebox-body">
    <div class="github-row">
  <div class="github-icon-container" title="Issue">
	  <svg width="60" height="60" class="github-icon" viewBox="0 0 14 16" aria-hidden="true"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg>
  </div>

  <div class="github-info-container">
    <h4>
      <a href="https://github.com/Project-MONAI/MONAI/issues/6280" target="_blank" rel="noopener nofollow ugc">Ensure usage of anything deprecated since 0.8 is removed</a>
    </h4>

    <div class="github-info">
      <div class="date">
        opened <span class="discourse-local-date" data-format="ll" data-date="2023-04-03" data-time="15:16:53" data-timezone="UTC">03:16PM - 03 Apr 23 UTC</span>
      </div>

        <div class="date">
          closed <span class="discourse-local-date" data-format="ll" data-date="2023-06-08" data-time="09:39:20" data-timezone="UTC">09:39AM - 08 Jun 23 UTC</span>
        </div>

      <div class="user">
        <a href="https://github.com/drbeh" target="_blank" rel="noopener nofollow ugc">
          <img alt="drbeh" src="https://avatars.githubusercontent.com/u/3968947?v=4" class="onebox-avatar-inline" width="20" height="20">
          drbeh
        </a>
      </div>
    </div>

    <div class="labels">
    </div>
  </div>
</div>

  <div class="github-row">
    <p class="github-body-container">There are several components that have been deprecated since v0.8 and many of th<span class="show-more-container"><a href="" rel="noopener" class="show-more">…</a></span><span class="excerpt hidden">em has been removed including all pathology related classes (addressed in PR #6262); however, there are still classes that have been used vastly throughout test cases, tutorials and bundles, so removing them requires some coordination with other monai repos and modifying the code that are utilizing them before removing them.

[UPDATE] The usage of below classes will be removed but they will be kept as a wrapper with an associated remove version of 1.3.

- [x] AsChannelFirst and AsChannelFirstd
- [x] AddChannel and AddChanneld
- [x] SplitChannel and SplitChannels</span></p>
  </div>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<p>From a programmer aspect(imo), this framework is maintained so poorly that you can’t even start because of conflicts.</p>