IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Images Discussion :

Supprimer un cylindre d un volume


Sujet :

Images

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Septembre 2008
    Messages
    93
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2008
    Messages : 93
    Points : 46
    Points
    46
    Par défaut Supprimer un cylindre d un volume
    After tackling the things above, you have to remove the U shaped object from the image.
    You don't have to use imfill necessarily; you can come up with anything. I can recommend
    another way to solve it. For example if you create a cylinder which has values 1 inside
    and 0 outside; and place it so that it contains only the VOI (volume of interest) we are
    interested and excludes the U shaped object; then you can multiply it with data which
    will solve the problem. You can implement it as follows:

    Toujours pour le même projet,
    Je dois supprimer de mon volume une forme en U

    J ai pense a utiliser un volume cylindrique qui contiendrait le volume d interet (valeur 1 a l interieur et 0 a l exterieur) et que je multiplierai avec par une bonne donnee pour supprimer ce U
    mais je bloque pour identifier X_DIM, Y_DIM, Z_DIM, RADIUS et leurs centres.

    Merci d avance

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    [X Y Z] = meshgrid(1:<X_DIM>, 1:<Y_DIM>, 1:<Z_DIM>);
    cylinder_mask = (X - <CENTER_ON_X_DIMENSION>).^2+(Y - CENTER_ON_Y_DIMENSION).^2 <
    <RADIUS>2;
     
    % Then finally you multiply it with the image;
    new_volume = uniform_volume.*cylinder_mask;

  2. #2
    Membre du Club
    Profil pro
    Inscrit en
    Septembre 2008
    Messages
    93
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2008
    Messages : 93
    Points : 46
    Points
    46
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    clear, close all
     
    d = dir('*.dcm');
     
    volume_data = zeros(256, 256, 224);
     
    slice_thickness = zeros(1,224);
     
    for i=1:numel(d)
    file_name = strcat('IM',num2str(i),'.dcm');
    dicom_info = dicominfo(file_name);
    anatomical_location_of_dicom_image = dicom_info.InstanceNumber;
    dicom_image = dicomread(file_name);
     
    dicom_image_resized = imresize(dicom_image, [256 256]);
     
    slice_thickness(anatomical_location_of_dicom_image) = dicom_info.SliceThickness;
     
    volume_data(:,:,anatomical_location_of_dicom_image) = dicom_image_resized;
    end
     
    high_res_volume = volume_data(:,:,1:75); 
    low_res_volume = volume_data(:,:,76:224);
     
    [X, Y, Z] = meshgrid(1:256, 1:256, linspace(1,75,56));
     
    resized_volume_data = interp3(high_res_volume,X,Y,Z);
     
    uniform_volume = cat(3, resized_volume_data, low_res_volume);
     
    [X, Y, Z] = meshgrid(1:256, 1:256, 1:224);
    cylinder_mask = (X - 128).^2+(Y - 128).^2 < 90.^2 ;
     
    % The line above creates a cyclinder in which  the interior region is 1 and the rest is 0
     
    %-------------HINT----------------------
    % And here you have to make a ELEMENT BY ELEMENT multiplication; however what you try below is a MATRIX multiplication
    % that is why it doesn't work
     
    new_volume = uniform_volume.*cylinder_mask;
     
     
    smooth_new_volume = smooth3(new_volume);

    Voila mon code qui normalement devrait etre bon mais apparement il y a une erreur de dimension que je n arrive pas a trouver...

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    ??? Error using ==> times
    Array dimensions must match for binary array op.
     
    Error in ==> task3edward at 97
    new_volume = uniform_volume.*cylinder_mask;
    Si quelqu un voit l erreur :p

    merci d avance

  3. #3
    Membre du Club
    Profil pro
    Inscrit en
    Septembre 2008
    Messages
    93
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2008
    Messages : 93
    Points : 46
    Points
    46
    Par défaut
    erreur de memoire
    juste clean all et relancer matlab a suffit

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [LVM] supprimer un volume physique
    Par Eusebius dans le forum Administration système
    Réponses: 6
    Dernier message: 22/03/2012, 18h17
  2. Réponses: 5
    Dernier message: 31/08/2008, 12h53
  3. Réponses: 9
    Dernier message: 06/11/2007, 12h36
  4. Supprimer "System volume information" ?
    Par hsazerty dans le forum Windows Serveur
    Réponses: 2
    Dernier message: 13/07/2007, 13h12
  5. [VB6] Supprimer un enregistrement dans une ListView ??
    Par Argonz dans le forum VB 6 et antérieur
    Réponses: 2
    Dernier message: 14/11/2002, 09h37

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo