Code Monkey home page Code Monkey logo

Comments (3)

cesomark avatar cesomark commented on July 25, 2024

Hi,
I have the same issue.
Did you find a solution @tkrwy ?

Thanks!

from msifromhe.

mbhashmi avatar mbhashmi commented on July 25, 2024

I used this code last year, as for some time I was reproducing these results: This might give a clue what you can do ... depends how you want to organize your data.

I am not using Matlab anymore, so can't provide a well-tested function, but just to get a clue, you can use/modify it as per your needs

%% COPY IMAGE TILES TO TRAIN AND TEST FOLDERS
mkdir('E:\STAD_MSI_Project\DX_TILES_NORM_SPLIT\TRAIN\MSIMUT')
mkdir('E:\STAD_MSI_Project\DX_TILES_NORM_SPLIT\TEST\MSIMUT')
mkdir('E:\STAD_MSI_Project\DX_TILES_NORM_SPLIT\TRAIN\MSS')
mkdir('E:\STAD_MSI_Project\DX_TILES_NORM_SPLIT\TEST\MSS')
%% now copy the files to the actual folder. This might take a while.
if doCopy
moveImagesToFolder(cliniPatient, allTileNames, msitrain,cnst.tileInputPath,cnst.tileOutputPath,'msitrain')
moveImagesToFolder(cliniPatient, allTileNames, muttrain,cnst.tileInputPath,cnst.tileOutputPath,'muttrain')
moveImagesToFolder(cliniPatient, allTileNames, msstrain,cnst.tileInputPath,cnst.tileOutputPath,'msstrain')

moveImagesToFolder(cliniPatient, allTileNames, msitest,cnst.tileInputPath,cnst.tileOutputPath,'msitest')
moveImagesToFolder(cliniPatient, allTileNames, muttest,cnst.tileInputPath,cnst.tileOutputPath,'muttest')
moveImagesToFolder(cliniPatient, allTileNames, msstest,cnst.tileInputPath,cnst.tileOutputPath,'msstest')
end

function moveImagesToFolder(cliniPatient, allTileNames, patientSet,tileInputPath,tileOutputPath, setStr)

% if strcmp(setStr, 'msitrain') || strcmp(setStr, 'muttrain')
% moveTo = [tileOutputPath, 'TRAIN\MSIMUT'];
% end
% if strcmp(setStr, 'msitest') || strcmp(setStr, 'muttest')
% moveTo = [tileOutputPath, 'TEST\MSIMUT'];
% end
% if strcmp(setStr, 'msstrain')
% moveTo = [tileOutputPath, 'TRAIN\MSS'];
% end
% if strcmp(setStr, 'msstest')
% moveTo = [tileOutputPath, 'TEST\MSS']';
% end

moveTo = 'E:\STAD_MSI_Project\DX_TILES_NORM_SPLIT\TEST\MSS';

lin_ind = find(patientSet == 1); % whether msitrain, msitest or else*
for i=1:length(lin_ind)
currPat = cliniPatient{lin_ind(i)};
matchedTiles = find(contains(allTileNames,currPat) ==1); % match all tiles
tot_tiles = length(matchedTiles);
for j=1:tot_tiles
moveIt = allTileNames{matchedTiles(j)};
moveItFrom = [tileInputPath, moveIt];
movefile(moveItFrom, moveTo)
end
end
end

from msifromhe.

cesomark avatar cesomark commented on July 25, 2024

Thank you for your insight @mbhahsmi !

from msifromhe.

Related Issues (9)

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.